Help - Search - Members - Calendar
Full Version: Recording, not conversion with LAME?
Hydrogenaudio Forums > Lossy Audio Compression > MP3 > MP3 - General
sln
Í have downloaded the lame.exe (ver. 3.90), and I have found out to convert a wav-file to mp3, from the commandpromt.

I want to do a recording from the soundcard in the same way. Is it possible, and if so how is it done.?
dev0
mp3DirectCut supports this using lame_enc.dll.

I remember a Win32 commandline tool, which recorded to stdout, but can't find it right now.
Mr_Rabid_Teddybear
HarddiskOgg can do that very well. You'll need to add lame_enc.dll yourself. It's a GUI program. If you want to do it from commandline I guess you can use a combo of piperec.exe and lame.exe.

Lame.exe and lame_enc.dll are available here.

EDIT: Commandline for piperec/lame can be something like:
CODE
piperec 44100 16 2 | lame --alt-preset standard - - > C:\test.mp3

EDIT2: Uh. This works equally well. Probably much the same:
CODE
piperec 44100 16 2 | lame --alt-preset standard - C:\test.mp3
sln
QUOTE (Mr_Rabid_Teddybear @ Jun 11 2005, 05:27 PM)
HarddiskOgg  can do that very well. You'll need to add lame_enc.dll yourself. It's a GUI program. If you want to do it from commandline I guess you can use a combo of piperec.exe and lame.exe.

Lame.exe and lame_enc.dll are available here.

EDIT: Commandline for piperec/lame can be something like:
CODE
piperec 44100 16 2 | lame --alt-preset standard - - > C:\test.mp3

*


QUOTE
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.
Mr_Rabid_Teddybear
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.
sln
QUOTE
Thank you for an exelent explanation. But I have still questions. Could it be possible to make 2 outputfiles from the same Pipe? 1 MP3 and 1 WMA ( using the commandline option in "Cscript.exe wmcmd.vbs -switches" ) Of couse I could test it myself, and I have done. No, it is not possible, because the 2 applications assumes different PCM formats, as I read it.
Mr_Rabid_Teddybear
QUOTE (sln @ Jun 11 2005, 12:31 PM)
QUOTE
Thank you for an exelent explanation. But I have still questions. Could it be possible to make 2 outputfiles from the same Pipe? 1 MP3 and 1 WMA ( using the commandline option in "Cscript.exe wmcmd.vbs -switches" ) Of couse I could test it myself, and I have done. No, it is not possible, because the 2 applications assumes different PCM formats, as I read it.

*


Why are you putting yourself in quote? It looks kinda weird..... wink.gif

Eh. Piperec is a rather simple program. But for encoding to two different formats from the same stream you could look into whether you could achieve this by the use of programs like M.A.R.E.O. or Wack. Theire mainly made for use with EAC, but who knows...? Maybe some scripting?
You're on your own here, this is beyond anything I've attempted to achieve.... You can try searching on the forums, or wait for someone more enlightened. smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.