QUOTE (sln @ Jun 11 2005, 10:56 AM)
It works. But I do not really understand the syntax in the commandline, and the usage of both lame.exe and piperec.exe. Is it the "|" sign? Where can I read more about this and the switches.
And do you know if I could find a duration switch ? I would like to tell how long the recording should take place.
if you check piperec in CMD, these are the options:
QUOTE
C:\>piperec
Usage: piperec <samplerate> <bps> <channels>
Output goes to stdout, hit any key to stop
Piperec records the sound from soundcard and sends it to stdout (standard out) with specified samplerate, bitdepth and channels. Lame can't do this on it's own AFAIK, but it can record from stdin (standard in). So
piperec 44100 16 2 says that piperec should record a 44,1kHz 16bit stereo PCM stream and send it into a pipe which symbol is
|On the other side of the pipe Lame are waiting. For the different Lame switches, like
lame --alt-preset standard, look
here.
The single
- can mean both stdin and stdout. Here you got
- - > C:\test.mp3 which tells lame to encode from stdin to stdout, then CMD (Windows) just take the output from stdout and makes a file test.mp3 in C: root (
> C:\test.mp3). But I guess
- C:\test.mp3 is just as good as it tells Lame directly to encode from stdin to a file test.mp3 in C: root. (I just modified Case's switches from
here. But it might be different with Speex? Don't know what's best.)
Lame syntax is:
QUOTE
usage: lame [options] <infile> [outfile]
<infile> and/or <outfile> can be "-", which means stdin/stdout.
So
piperec 44100 16 2 | lame --alt-preset standard - - > C:\test.mp3 are piperec to stdout through a pipe and into lame from stdin, encode to stdout and make file test.mp3.
Piperec only have the option of recording until you manually stop it. Get the CMD window in focus and hit any key (personally I'm in the habit of using CTRL+C for terminating processes, but that's just old habit). For timer functions you'll have to look into other apps.
BTW. For those who wonder. Described procedure will demand both piperec.exe and lame.exe in searchpath.