Encoding Audio

You’ll need to encode your audio files in both MP3 and Vorbis formats to reach the widest possible audience, and to do that, you’ll use a couple of tools.

For encoding MP3 files, LAME will give you the best quality.[98] You’ll want to use a variable bit rate when you encode. You can get a high-quality encoding using something like this:

 
$ ​lame in.wav out.mp3 -V2 --vbr-new -q0 --lowpass 19.7

For Vorbis audio, you can use Oggenc.[99] To encode a good-sounding Vorbis file using a variable bit rate, you’d use something like this:

 
$ ​oggenc -q 3 inputfile.wav

You can learn more about MP3 and Vorbis encoding at Hydrogen Audio.[100] The information there is excellent, but you’ll need to experiment with settings that will work for ...

Get HTML5 and CSS3, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.