Question

I'm running lame to convert a WAV sound in MP3, executing as console application:

ProcessBuilder pb = new ProcessBuilder(new String[]{"lame", "in.wav", "out.mp3", "-b", "128"});
Process p = pb.start();
try {
    p.waitFor();
} catch (InterruptedException ie) {
    logger.error("Error calling lame", ie);
}

When I'm reading the output, the "normal" output is empty, but the err has values. It's an execution error, or the lame do all output as err.

Was it helpful?

Solution

See yourself. Run that command in terminal and redirect stdout and stderr to different files. Then you'll know where it goes:

lame in.wav out.mp3 -b 128 1>stdout 2>stderr
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top