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.

stereo_mix.png

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.

warning_msg1.png

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:

  1. Open up Audacity
  2. Select “Stereo Mix” from the input source combobox
  3. Start recording (red circle)
  4. Start playing the audio file you’d like to record
  5. Adjust the input volume so the sound wave indicator isn’t peaking out
  6. Once the audio file is done, stop recording by pressing the stop button (yellow square)
  7. Use the cursor to select any dead space on the beginning or end of the audio file
  8. Delete the deadspace by hitting the delete key.
  9. Start the export-to-mp3 process by going to the File menu and selecting “Export As MP3″
  10. Enter a file name for the new mp3 file and hit Save
  11. Enter ID3 tags for the new mp3
  12. Done!

.
Download files for this article:

Synergy 1.3.1 Installation Tutorial (On Windows)

Over the last couple years, I’ve read about a cool opensource keyboard/mouse sharing program called Synergy. Finally I decided to stop reading about it and start using it!

First, let me explain a bit more about Synergy. Have you ever been working on your desktop PC, with your keyboard in front of you, with your laptop sitting on the desk next to the keyboard? When you were actively using the laptop, you’d rotate your body, use the laptop keyboard and touchpad (yuck), and then spin back to the desktop keyboard and mouse when you were done with the laptop.

With Synergy, you can have your laptop set up to, say, the left side of your desktop’s monitor. To use the laptop, you’d just move your mouse over to the laptop monitor, and suddenly your keyboard and mouse (plugged into your desktop PC) would work on your laptop! Totally awesome. And free.

Here are some quick highlights:

  • clipboard data gets automatically synchronized (including binary data, such as a screenshot)
  • can work across different platforms (Linux, Windows, Mac)
  • great performance under most circumstances
Installation

I found a decent installation article on LifeHacker, but I ran into a couple of slightly confusing issues during my own installation/configuration, so I figured others may benefit from a little guide.

First, grab the Synergy installation file.

While that’s downloading, you can decide which computer will be your main system. This is the system whose mouse and keyboard you’ll use to access all systems.

Once the installation file is done downloading, hop on your main computer (we’ll call it the Synergy server) and launch the installation file. It’s a nice little NSIS installer, so it’s simple and quick. Just accept the default options and walk right thru it (should take like 5 seconds).

Run the installer on the other computers that you’d like to control from your main keyboard/mouse.

Server Configuration

Synergy uses a configuration textfile to store configuration settings. This file tells Synergy how your computers are arranged, so Synergy knows which system you want to control when you move your mouse to, say, the far left side of your desktop’s monitor.

The version for Windows has a nice little wizard that helps you create the configuration file. Some of the configuration rules are a bit confusing, so I’ll give you some screenshots to get you going.

Launch Synergy from the shortcut on your desktop or Start menu. You’ll see a screen like this:

(I apologize for the nasty screenshost…I’ll work on fixing this soon)

Make sure you’ve got “Share this computer’s keyboard and mouse (server)” selected.

Now, click on the “Configure” button. You’ll see a screen like this:

You’ll need to first add the names of all workstations that will be using Synergy to the list of “Screens”. I know, a screen isn’t a computer…but this is how Synergy thinks, so we’ll have to just live with it :)

(If you don’t already know the name of your desktop, a quick way to find it is to open up a command window and type “hostname” (without the quotes) and hit enter.)

I’ll be using my desktop PC (called “falcon”) and my laptop PC (called “eagle”), so enter those names into the “Screens” list by click on the “+” button. This launches another screen:

All you need to do is enter a Screen Name (for me, that would be “falcon”, for the name of my desktop) and click “OK”. The other options don’t need to be touched for now.

Follow the same steps to add your laptop name to the screens list, so it looks like this:

Now, we move on to the slightly confusing part: Links. The link entries are required so that Synergy knows how you have your monitors arranged. In my case, I have my laptop (eagle) to the left of my desktop (falcon). Synergy needs two “Link” entries to describe this relationship. This is the part that I messed up on…I assumed that Synergy could figure out that “eagle” is to the left “falcon” if I told it that “falcon” is to the right of “eagle”. But apparently it can’t. If you don’t add both links, you’ll end up getting your mouse “stuck” on a screen.

So, here are the two Link entries I used:

Don’t forget to press the “+” button to add this Link to the list!

And the second one:

The final configuration looks like this:

Now, just press “OK” to close the “Screens & Links” form, and then press “Start” back on the first form to get the Synergy server running. You’ll see a little message telling you that Synergy was successfully started.

Client Installation

Guess what?! The client installation is an absolute piece of cake compared to the server installation.

Here what you have to do: on your client box (my laptop, in my case) find the Synergy icon (on the desktop or in the Start menu) and start Synergy. You’ll see the following screen:

Make sure the “Use another computer’s shared keyboard and mouse (client)” option is selected.

Simply type in the name of your server (in my case, “falcon”), and click “Start”. That’s it! After a couple seconds, you should be able to move your mouse from on computer to the other!

After you’ve enjoyed the magic of Synergy for a couple minutes, check out the documentation at http://synergy2.sourceforge.net/. Once of the first things you’ll probably want to do is to have Synergy automatically start when your computer starts up. Click on the “AutoStart” button (see the screenshot above) to explore your options.

Have fun!

Started the wiki up

I installed MediaWiki over the weekend. I’m still learning how to use it all, but I really like how simple it is to add/edit content. I’ve put up my first article, regarding the best way to get the id of a just-inserted record (you can see it here). I’m looking forward to adding to my KB!

[Edit] The wiki is down right now…should be back up shortly.

Search and Replace tool (by Funduc)

Every programmer needs a good search tool. I use mine several times a day…well, I do now that I’ve found Search and Replace by Funduc. It’s shareware, so you can try it yourself before you buy it (for $25). Here’s a list of the best features (in my opinion):

  • super fast
  • search across multiple files and directories
  • set a file mask so it only searches certain files
  • lets you specify a backup directory for safe replaces (or you can use the ‘undo’ feature)
  • great color-coded output window (see screenshots on their website)
  • allows for certain regex operators

Sweet tool. Worth every penny.  It’s grep for people like me.

TrackMyHours review

I’ve been looking for a  good way to easily track my hours a project, but all the tools I’ve looked at so far haven’t fit the bill.  I need a tool that was:

  • web-based
  • simple to use (not a whole lot of setup)
  • inexpensive
  • made nice reports for me

TrackMyHours.com has been great for me so far.  It’s web-based, very simple to use (and add new projects, etc), is only $8.95 a month, and it’s very easy for me to export data, create invoices, and view a quick report of my hours for certian projects within several timeframe (today, this week, last week, last two weeks, this month, all dates).

Sure, I’d like to make some that perfectly fits my needs, but for right now, this really does what I need, and $9 a month is totally worth it (for me at least).

When paired with the free TimeLeft 3 tool, it’s a great time-tracking combination.

The best free keyboard shortcut utility, and so much more

I was searching for a free app to create gobal keyboard shortcuts, and I found AutoHotKey. I’ve been testing it out, and I love it! It’s great! It’ll require a bit of a learning curve, but once you understand the ‘ini’ file that sets up the shortcuts, you’re golden.

One of the great features I love about AutoHotkey is that it lets you use the Windows key for your shortcuts. Simple enough, but many of the shortcut programs I looked at before wouldn’t let you do that. The other thing I loved about it is that it lets you activate a program if it’s already open (maximize and set focus), or launch the program if it’s not open yet. Very cool.

Check it out…there are so many more features that I haven’t described or even looked at yet.

Too many ideas!

I have a problem.  I have too many ideas running around in my head, and I think it’s starting to slow me down a bit.  Brett used to tell me I had to crack open a new thread whenever I started thinking ahead of myself in a conversation…but I think I’m starting to run out of RAM!

Okay, it’s not as bad as all that.  But I do have to focus on some main goals, and allow other cool ideas to be moved to the back burner.  One of the things I want to keep on the front burner is this blog, and so I’m going to take some steps to make sure that happens.

So!  Over the next couple days, I’ll start reviewing and talking about my experiences with programming as a whole, general web development, Flash programming, great free tools I use (some of them OSS), my thoughts on multiple monitor setups and the value in good equipment, and anything else that I think is worth remembering.

Somethings you have to say things just to hear yourself say it, ya know?