How to record audio off the internet
A friend come up to me at work today and asked if I knew of any way to record and save a song she had heard on the internet. It should go without saying that the legalities of this should be investigated a bit before trying this yourself, but in this case, I felt comfortable that we were within the law.
I’ve had the pleasure of using Audacity for the past several years, and I can’t say enough great things about it. You really should check it out if you’ve never heard of it or used it. I found it when I was looking for something a bit better than Windows built-in Sound Record to record some stuff for school, and I used it for so many other things since. It’s free, open source, and available for Windows, Mac and Linux.
The feature most interesting right now is the ability to record whatever sound is playing through the sound card on the computer. All you have to do is fire up Audacity and choose “Stereo Mix” from the input combobox.
After selecting “Stereo Mix”, just click the record button (red circle), adjust the volume, and enjoy the show. After you’ve finished recording by pressing the stop button (yellow square), there’s a good chance you’re going to want to save the recording as an MP3. No problem, Audacity has the ability to do that. Just click on the File menu, then click on “Export As MP3″. Type in a file name and yet enter…and then, you get a message box telling you to download lame_enc.dll and tell Audacity where it is.
I’m sure they do this for some legal reasons, but I know that my friend is going to have a bit of a hard time following all the steps required to locate lame_enc.dll, unzip it to a folder they won’t delete later, and tell Audacity where it was at.
This shouldn’t be too hard to do programmatically, right? We just need to copy a file (lame_enc.dll) to the user’s hard drive, and then tell Audacity where that dll is at. This is one reason why I like open source programs; they’re normally very discoverable. So if you were an Audacity developer, were would you store a path to the lame_enc.dll to that Audacity could find it? I downloaded the dll myself and told Audacity where it was at through the GUI, and then started looking for the place that Audacity stores that information. A brief search of the Audacity directory in Program Files didn’t turn up anything obviously, so I turned to the registry. Bingo. HKEY_CURRENT_USER\Software\Audacity\Audacity\MP3 contains a key called “MP3LibPath”. The value for this key pointed to the dll that I had told Audacity about!
Enough of the technical mumbo-jumbo. If you’d like to learn more about the installer I created, check out the related HBB article.
So once you’ve installed Audacity and the LAME dll (via the installer linked at the bottom of the this article), all you have to do is:
- Open up Audacity
- Select “Stereo Mix” from the input source combobox
- Start recording (red circle)
- Start playing the audio file you’d like to record
- Adjust the input volume so the sound wave indicator isn’t peaking out
- Once the audio file is done, stop recording by pressing the stop button (yellow square)
- Use the cursor to select any dead space on the beginning or end of the audio file
- Delete the deadspace by hitting the delete key.
- Start the export-to-mp3 process by going to the File menu and selecting “Export As MP3″
- Enter a file name for the new mp3 file and hit Save
- Enter ID3 tags for the new mp3
- Done!
.
Download files for this article:


October 17th, 2008 at 8:45 am
Sweet! I knew Mac’s had this capability with Audio Hijack, but I didn’t dig deep enough into Audacity to see this capability.