Valhalla Legends Forums Archive | C/C++ Programming | Recording from line in?

AuthorMessageTime
zorm
Anyone happen to know how to record from line in using C++? Would like to save it to mp3 but I can deal with saving it to wav and converting.
October 21, 2003, 1:19 AM
Adron
As with everything, there are several ways. I've used two of them.

You can use MCI which is simple and not very powerful at all. Send a command to start recording to a file, another to stop.

You can use the low level audio functions - much more powerful. You pass buffers to the sound card, it fills them with wave input data. These are what I mostly use for capturing sound.

You could probably also use DirectSound/DirectShow, which might enable you to both capture and encode audio in realtime. I have no experience with doing that programmatically though.


To switch to the right input, you might want to use the audio mixer services

It seems that the Audio Compression Manager might allow you to do the mp3 encoding programmatically, if you have such a codec. Many applications use LAME instead.
October 21, 2003, 8:46 AM
zorm
Thanks Adron great information. +1
October 21, 2003, 3:21 PM
Adron
Actually, I forgot to ask what OS it was for, I just assumed Windows. For linux, I have a fully working recording app that reads from line in and writes mp3 files using a forked lame.
October 21, 2003, 9:13 PM
St0rm.iD
If you are looking for apps to do it, LAME, Winamp, and Cooledit can do it rather well.
October 22, 2003, 12:39 AM

Search