Dear Speex codec community: I am working on conversion of voice files. I could not figure out how to use speexdec.exe 1.2.3 in piped mode in order to avoid the creation of the potentially large intermediate *.wav or *.pcm files. Any pointer to web or file of instruction is appreciated. Attempt (one long command line, failed): type d:\test.spx | "d:\speex 1.2.3\bin\speexdec.exe" - - | "d:\lame 3.97\bin\lame.exe" --preset voice - - > d:\test.mp3 Undesirable (working, 2 steps, create intermediate *.wav): type d:\test.spx | "d:\speex 1.2.3\bin\speexdec.exe" - d:\test.wav type d:\test.wav | "d:\lame 3.97\bin\lame.exe" --preset voice - - > d:\test.mp3 In contrast, conversion from mp3 to spx using speexenc.exe 1.2.3 and lame.exe 3.97 in piped mode works fine. Sincerely, Ray Jahn
Jahn, Ray (R.) a ?crit :> Dear Speex codec community: > > I am working on conversion of voice files. I could not figure out how to use speexdec.exe 1.2.3 in piped mode in order to avoid the creation of the potentially large intermediate *.wav or *.pcm files. Any pointer to web or file of instruction is appreciated. > > Attempt (one long command line, failed): > > type d:\test.spx | "d:\speex 1.2.3\bin\speexdec.exe" - - | "d:\lame 3.97\bin\lame.exe" --preset voice - - > d:\test.mp3Probably the reason why this doesn't work is that by default, speexdec outputs a raw file and not a wav file. So you'll want to pipe it into something that adds the wav header (e.g. sox). Jean-Marc
On Fri, Apr 4, 2008 at 12:19 AM, Jean-Marc Valin <jean-marc.valin at usherbrooke.ca> wrote:> Jahn, Ray (R.) a ?crit : > > > Dear Speex codec community: > > > > I am working on conversion of voice files. I could not figure out how to use speexdec.exe 1.2.3 in piped mode in order to avoid the creation of the potentially large intermediate *.wav or *.pcm files. Any pointer to web or file of instruction is appreciated. > > > > Attempt (one long command line, failed): > > > > type d:\test.spx | "d:\speex 1.2.3\bin\speexdec.exe" - - | "d:\lame 3.97\bin\lame.exe" --preset voice - - > d:\test.mp3 > > Probably the reason why this doesn't work is that by default, speexdec > outputs a raw file and not a wav file. So you'll want to pipe it into > something that adds the wav header (e.g. sox).Alternatively, lame has a -r option which tells it to assume the input is raw pcm (no wav headers). I've used a command line like this to encode into mp3s: $ speexdec --mono --rate 8000 foo.spx - | lame -b 32 -q 9 -s 8 -m m - foo.mp3 Note that with lame 3.97 I also had to use the -x option to swap input bytes. This was not required with lame 3.98b6. Pete