
Basics of digital sound theory Part 4

The MP3 algorithm allows you to compress the sound 20 to 30 times while maintaining good quality.

The full quality of the CD is believed to be preserved at a bit rate of approximately 160 Kbps (the concepts of “sample rate” and “sample bit depth” do not apply to MP3 files). However, in most cases, much more compressed audio is quite acceptable. Therefore, in Flash animations, MP3 compression is usually used, which gives a bit rate of the order of 16-32 Kbps. The Flash player supports a range of bit rates ranging from 16 to 160 Kbps. You must select the most suitable based on film size and sound quality requirements. It is often worth leaving the MP3 file at the same quality as imported (therefore, the Use imported mp3 quality setting is on by default). If the quality changes, then the change should be in the direction of decreasing quality, but not increasing.
If the sound is processed in an external editor, you can take into account the fact that the Flash player supports not only the MP3 algorithm, which is part of the MPEG1 Layer 3 standard, but also newer algorithms (MPEG2 and MPEG2.5), that provide better sound quality when bit depth is low. In addition, the player supports MP3 encoding with both constant and variable bit depth (in the latter case, the best compression ratio is achieved).
The MP3 format is optimal for rash projects. Therefore, in practice, it is practically only used. Furthermore, MP3 files can be loaded dynamically, and they also have very useful ID3 tags with information about this sound.
• Nellymoser. A relatively new compression algorithm developed by Nellymoser Inc. Designed to compress human speech. His main idea is that a human voice can include vibrations with frequencies in a fairly narrow range. The upper and lower components can be discarded. Very low amplitude harmonics are also eliminated. The result is compression comparable to MP3 compression, but the sound quality is higher. More details about the Nellymoser algorithm can be found on the developer’s website http://www.nellymoser.com/.
The Nellymoser algorithm codec is included in the player only in Flash MX.
In the Flash IDE, Nellymoser compression is called Speech. You can adjust the quality / size ratio when using Nellymoser compression by changing the sample rate.
You can also include uncompressed audio in your SWF movie. In the development environment, this mode is called Raw. In this case, you can change the bit depth and sample rate. In theory, you can use uncompressed audio if sound quality is significantly more important than movie size (or, even less likely, if you need to save computing resources). In practice, however, it is better to use MP3 compression with a high bit rate (more than 120 Kbps).
Storage formats
There are quite a few audio formats. By default, Flash only allows you to import two of them.
• WAV. The main format for storing uncompressed audio on the Windows platform. Supports mono and stereo audio, various samples, and bit depths. Usually it is WAV where the analog signal is digitized, and only then is one of the compression algorithms applied. WAV files are extremely large, which is why this format has been significantly replaced by MP3. However, WAV is still the main format for professional sound editors like SoundForge.
• MP3. Audio format using the compression algorithm described above. The main format in the case of Flash, as it perfectly combines good sound quality and a small file size. Also, sound files in this format, unlike WAV files, can be dynamically loaded into a movie using the loadSound () method of the Sound class.
If you have QuickTime 4 or higher installed, you can import files in AIFF, QuickTime, Sun AU formats additionally.



