Doug Sparling

Mobile/Web Developer

Category: linux

Convert mp3 bit rate and change from stereo to mono

by Doug Sparling

I listen to a lot of podcasts, and sometimes I like to keep the files around. However, often a simple audio podcast uses a high bit rate and often stereo, resulting in a large file size when it’s not really necessary. So unless I want the highest quality mp3 file possible, I stick with the BBC Future Media Standards and Guidelines. For podcasts, it’s something like the following:

  • MP3 Mono Speech: 64 kbps, 44.1 kHz, constant bit rate
  • MP3 Stereo Music: 128 kbps, 44.1 kHz, constant bit rate

Here’s a typical FFmpeg command I run to simultaneously convert a stereo file to mono, and to lower the bit rate to 64K: (Obviously, change the filenames as necessary.)

$ ffmpeg -i stereohighbitratefile.mp3 -ac 1 -ab 64k mono64kfile.mp3

HT to Richard Farrar.

Setting user-agent in curl or wget

by Doug Sparling

$ wget --user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:32.0) Gecko/20100101 Firefox/32.0" -c http://www.example.com/file.txt

$ curl -A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:32.0) Gecko/20100101 Firefox/32.0" -O http://www.example.com/file.txt