Preparing Audio for the Internet In Part VI of our ongoing series, Scott Christie demystifies MPEG compression.

n this tutorial it’s time to look at MPEG. The arrival of MPEG sampling rates were 32k, 44.1k, or 48k. audio onto the web almost single-handedly heralded the birth of An addition to the MPEG-1 standard was developed later which Ithe web-music mania that has pervaded the Internet over the last introduced, among other things, multichannel sound and, more inter- couple of years. While RealAudio, Shockwave and Quicktime are estingly for web audio, the use of lower sampling rates. This became frequently used in the promotion and marketing of on-line music – known informally as MPEG-2. MPEG-2 now provided encoding of in the form of streamed excerpts or on-line radio stations – MPEG source files with 16k, 22.05k, and 24k sampling frequencies. is usually the technology of choice for delivering high quality audio Unfortunately the development of MPEG-2 created the great files. The reasons for MPEG audio’s popularity on the Internet are dilemma of MPEG audio file naming conventions: does .mp2 mean a essentially its impressive audio quality capability at relatively low MPEG-1 audio file with Layer II encoding, or just a MPEG-2 file with bit rates, and the broad range of free shareware or low cost an unspecified Layer number? Furthermore, some assumed . files encoding/decoding applications available. The complete lack of a meant a new MPEG-3 audio standard – which doesn’t and won’t ever copyright facility in the MPEG specification has also gone along exist since the next MPEG standard is MPEG-4! way to making it a web favourite. Confused?!? Well the MPEG-4 spec – currently at MPEG-4 Version 2 – is finalised but is yet to be implemented, so for the MPEG Defined moment the only MPEG files you’ll encounter on the web are MPEG stands for the Motion Picture Engineers’ Group, an interna- MPEG-1 Layers I, II and III (encoded from 32k, 44.1k, or 48k tional standards body responsible for developing a data reduction source files) or MPEG-2 Layers I, II and III (encoded from 16k, encoding/decoding technology for moving pictures and associated 22.05k, and 24k source files). Remember the layer number repre- audio. Major players in the creation of the MPEG audio spec sents the complexity of the encoding algorithm and is independent include the Franhouffer Institute in Germany, Dolby and . of the source file sample rate. Before the Internet, MPEG was – and still is – used extensively for the cost effective storage of digital media, and hence has a large MP3? Oui! presence in digital broadcast, video capture/post production and, By far the most popular encoding for MPEG audio these days on most recently, DVDs and portable MPEG audio players. the web is the MPEG-1 Layer III file, commonly known as MP3. It’s important to note that because MPEG is not a proprietary The choice of MP3 comes from the fact that the algorithms for technology owned by a particular company, but a ‘standard’, it is MPEG-1 Layer III audio files were designed from the onset to therefore able to be incorporated into numerous applications, mul- obtain the highest possible audio quality from relatively low bit timedia technologies and operating systems without corporate rates – typically around 64kbps per channel. (Incidentally, competition – particularly in terms of playback/decoding. This Shockwave Audio files developed by Macromedia are in fact a pro- goes some way to explaining MPEG’s lack of copyright facility, prietary form of MP3 and can be played back in standard MP3 since the potential for Internet audio distribution and commerce players if the .mp3 extension is added to the filename.) was not within the scope of the original MPEG specifications’ Specifically, the MPEG-1 Layer III algorithm adds a number of technical guidelines. ‘advanced features’ to Layer II (time to don the labcoats!): the The original MPEG standard for moving pictures and audio was frequency resolution is 18 times higher, which allows a Layer III termed MPEG-1. Within this MPEG-1 standard the audio content encoder to adapt the quantisation noise much better to the was broken down into three techniques or ‘layers’ of encoding based masking threshold; only Layer III uses what’s known as entropy on the complexity of the encoding algorithm – Layer ‘I’ being the coding (like MPEG video) to further reduce redundancy; only least complex and Layer ‘III’ being most complex. (Roman numerals Layer III uses a bit reservoir (like MPEG video) to suppress were used to denote the layer number. The higher-numbered layers, artefacts in critical moments; and Layer III uses more advanced being more complex, obtain better audio quality at lower bit rates, joint-stereo coding methods (more on this later). The MPEG-1 but take longer to encode and thus are more demanding on a spec also has the highly convenient ability to encode 44.1k source computer’s CPU). Thus the various flavors of MPEG-1 audio files files, i.e. CD audio. For a refresher on the basics of MPEG were named .mp2 or .mp3 reflecting the layer of complexity used in encoding/decoding, have a read of the Data Reduction section in encoding. MPEG-1 only supported encoding of source files whose the first ‘Preparing Audio for the Internet’ tutorial [AudioTechnolo-

55 gy Volume 1, Issue 4]. For more MPEG info than you can point a these advanced encoding algorithms. Again, check out MP3.com’s mouse at, head for www.mpeg.org/MPEG/audio.html. From http://software.MP3.com/software/ pages and download the here on in I’ll use the term MP3 since this is the flavour that has freeware and demo versions that get the good ratings. almost generically come to mean MPEG audio on the Internet. When you create your first MPEG audio file you’ll come across a number of encoding options, such as Bit Rate and Layer that Special Delivery should now be familiar to readers of this column, and also a few In terms of delivery, MP3 playback on the web has up until that probably require some explanation. These include: CBR recently been a download-only type of technology. This means (Constant Bit Rate), VBR (Variable Bit Rate), Joint Stereo and Dual that the entire audio file had to be downloaded to your hard drive Stereo. Let’s have a look at each of these in turn. before any playback was possible. This stems from MP3’s optimum CBR (Constant Bit Rate encoding) is an encoding method that bit rate of 64kbps (12:1 data reduction) per channel, which, while varies the audio quality level in order to ensure a consistent bit rate low in comparison to the other MPEG audio layers, is still too high throughout an encoded file. In order to maintain constant bit rate for the near instantaneous playback required for streaming Internet throughout the file, difficult passages – passages containing a rela- audio over a modem connection. Remember RealAudio and tively wide stereo separation – may be encoded with fewer than Quicktime’s data rates for streaming audio are 20kbps and 24kbps the optimum number of bits. When encoding easy passages – over a 28.8k modem, and 32kbps over a 56k modem connection – passages containing silence or a relatively narrow stereo separation so 64kbps is really pushing it. Hence the benefits of MP3 is its – the Encoder uses more bits than necessary in order to maintain audio quality, but this comes at the expense of download time. the constant bit rate. Consequently, difficult passages may experi- Many websites therefore offer a preview of song files in RealAudio, ence a decrease in quality, while easy passages may include Quicktime or Shockwave but then provid the full length versions in unused bits. CBR encoding is used when you need to limit the size MP3 format. of the MP3 file or produce consistent and predictable file sizes. The latest big thing in MPEG audio on the web is streaming CBR encoding produces MP3 file sizes that are easily predicted by MP3 audio files. A company called @Soft has developed Shoutcast multiplying the bit rate by the duration. server technology that delivers the streaming MP3 files to the VBR (Variable Bit Rate) is an encoding method that ensures con- WinAmp MPEG audio player (PC) application. For details, head for sistently high audio quality throughout an encoded file by making www..com/download/listener.phtml. Mac users intelligent bit-allocation decisions during the encoding process, should head for www.macast.com/download.shtml. Since the based on a scale which you usually set in the Encoder settings files are still a bit on the large size, I wouldn’t try this unless you’ve options. Overall, VBR encoding produces a higher and more consis- got at least a 56k modem connection. tent quality level than Constant Bit Rate (CBR) encoding. When the MP3 playback on your computer generally requires you to Encoder encounters the difficult passages in the audio source, VBR download a standalone MP3 player application that is launched when encoding allocates additional bits to that section, ensuring the audio your browser encounters any file with the .mp3 file extension. The quality. When the Encoder encounters the easy passages it allocates undisputed centre of the MP3 universe for getting your hands on fewer bits to that passage, reducing unused bits. As a result, your MP3 software is www.MP3.com. If you require a player or encoder MP3 file consists of variable bit rates throughout the file because the application, head for http://software.MP3.com/software/ and Encoder allocates the bits where they are most needed. VBR you’ll find a plethora of applications for both PC and Mac, along encoding was developed for use when consistent audio quality is the with handy reviews and ratings of the software. Make sure you top priority and constant or predictable encoded MP3 file size is not read and follow any of the instructions that come with your MP3 critical. MP3 players may inaccurately report the duration of VBR- sotware, as you may have to configure your browser’s MIME types encoded files. If the MP3 player cannot accurately determine the to recognise the MP3 file types and launch the appropriate MP3 time, seeking in the file may also be unpredictable. player application. Once installed, head back to www.MP3.com to The Joint Stereo encoding option allows for an overall higher test your MP3 playback performance. audio quality at the expense of stereophonic information. In its basic Anyone with the latest versions of the RealAudio or Quicktime form, Joint Stereo encoding combines or ‘monos’ frequency sub- Players already has MP3 playback capability, since MP3 decoding is bands, highest frequencies first, so less space is required to encode built into both of these applications – a testament to the all- the entire file. MP3 encoding employs other more advanced stereo pervading success of MP3 as a format. In fact, the latest Quicktime encoding techniques such as MS Stereo (Middle/Stereo) and plug-in for Mac browsers (Nav and IE) can handle the playback of Intensity Stereo encoding in order to reproduce the best possible MP3 audio files from inside the browser itself, not requiring the stereo image using the lowest amount of bits. MS Stereo uses one launch of a standalone player application. If your main interest is in channel to encode information that is identical on the left and right just playing back non-streaming MP3 files off the web then I’d channels and the other channel to encode the differences between recommend just using RealAudio or Quicktime, and save yourself the two channels. Intensity Stereo encodes only bits that are the hassle of downloading and setting up additional software. perceived to be important to the stereophonic image. Dual Stereo includes two completely independent encoded The Encoders channels (left/right), each with half the total bit rate. In effect, it is MP3 encoding usually requires a standalone application. This can two mono files packed into a single file. Dual Stereo is generally vary from freeware applications to professional (read: ‘expensive’) only used for multi-lingual audio programs. plug-ins for ProTools and the like. The quality of the encoder can That’s it for this discussion on MPEG though we’ll be looking at vary significantly since certain advanced features of the encoding another flavor of MPEG known as MPEG-2 AAC when we look at process are, in fact, actually owned by companies which charge a Liquid Audio. licensing fee. Freeware encoders are therefore unlikely to contain AT

56