Convert WAV to MP3 or MP3 to WAV

By  on  

Boy I would have loved this post a decade ago when I was ripping CDs from my local library.  The memory is actually quite hilarious:  I would request 100 CDs at a time from the local library system, pick up however had been delivered at 10 a.m. that morning, and return them at 5 p.m. that day.  I had a giggle with the librarian in those days but the real giggle was the fact that the WAV files were bloating up my hard drive.

The following simple command would convert those WAV files to MP3s:

ffmpeg -i song.wav song.mp3

Of course converting from MP3 to WAV would simply be swapping the extensions in the command above.

ffmpeg is a marvel of a utility.  Video conversion, audio conversion, and probably the key to world peace.  Thank you ffmpeg!

Recent Features

  • By
    Chris Coyier’s Favorite CodePen Demos

    David asked me if I'd be up for a guest post picking out some of my favorite Pens from CodePen. A daunting task! There are so many! I managed to pick a few though that have blown me away over the past few months. If you...

  • By
    fetch API

    One of the worst kept secrets about AJAX on the web is that the underlying API for it, XMLHttpRequest, wasn't really made for what we've been using it for.  We've done well to create elegant APIs around XHR but we know we can do better.  Our effort to...

Incredible Demos

  • By
    Growl-Style Notifications Using MooTools Roar

    When I think of premier MooTools plugin developers, Harald "digitarald" Kirschner is usually one of the first people that come to mind. Harald has built some of MooTools' most popular plugins, including AutoCompleter, FancyUpload, and History Manager. My favorite plugin created...

  • By
    CSS Rounded Corners

    The ability to create rounded corners with CSS opens the possibility of subtle design improvements without the need to include images.  CSS rounded corners thus save us time in creating images and requests to the server.  Today, rounded corners with CSS are supported by all of...

Discussion

  1. Mark Progano

    If you’re on a mac and you want to do it on your machine, after installing X-Code,type in brew install ffmpeg

  2. If you also want to edit your audio first, Audacity has been a trusty companion for years now. Looks like arse, works like a charm. http://audacity.sourceforge.net/

  3. MaxArt

    Back in the days, the best mp3 converter was LAME.
    I don’t know if something better came out in the meanwhile, but it’s a highly customizable multiplatform tool.

    It looks like ffmpeg can use the libmp3lame audio codec, I guess it would be nice to know how to use it.

  4. yes, LAME pretty much was the bee’s knees.

  5. Kimomat

    Great tool! A gulp package is also available: https://github.com/cab/gulp-ffmpeg

  6. I have usef ffmpeg for converting images to video. very useful for that.

  7. No joke.. 5 years ago, it would have been such a savior.

Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!