APPENDIX A: Audio Concepts, Terminology, and Codecs 657
which supports nine discrete settings from 6.6 to 23.85kbps audio bit-rates, sampled at 16kHz. This
is a high enough sample rate where voice is concerned. This is the codec to use for a narrator track,
if you were creating interactive ebook applications, for instance.
There is also an AMR-NB (Adaptive Multi-Rate Narrow-Band) standard in Android, which supports
eight discrete settings, from 4.75 to 12.2kbps audio bit rates sampled. This can be an adequate
sample rate if the data going into the codec is high quality, or if the resulting audio sample does not
require a high quality due to the noisy nature of the content (such as a bomb blast).
Finally, there is PCM (Pulse Code Modulated) audio, commonly known as the WAVE or .WAV audio
format. Many of you are familiar with this lossless digital audio format, as it is the original audio format
used with the Windows operating system. It is lossless because there is no compression applied
whatsoever! PCM audio is commonly used for CD-ROM content, as well as for digital telephony
applications. This is because PCM WAVE audio is an uncompressed digital audio format, and
therefore has no CPU-intensive compression algorithms applied to the data stream. Thus, decoding
(CPU overhead) the data is not an issue for the telephony equipment or for affordable CD players.
For this reason, when you start compressing digital audio assets into the various file formats, you
can use PCM as a “baseline” file format. You probably won’t put it into your .APK file, however,
because there are other formats (such as FLAC and MPEG4 AAC) that will give you the same quality
using an order of magnitude less data.
Ultimately, the only real way to find out which audio formats supported by Android have the best
digital audio codec result for any given audio data instance is to actually encode your digital audio
in the primary codecs that you know are well supported and efficient. This process is covered in
Chapter 12, where you can observe the relative data footprint results between the different formats
using the same source audio sample.
Digital Audio Optimization: Device Compatible
Optimizing your digital audio assets for playback across the widest range of Android devices in
the marketplace is easier than optimizing your digital video or digital imagery (and thus animation)
across Android devices. This is because there is a much wider disparity of screen resolutions and
display aspect ratios than there is a disparity of digital audio playback hardware support across
Android devices, except for some Android hardware which features 24-bit (HD) audio playback
hardware compatibility.
This is because our ears can’t perceive the same quality difference in audio that our eyes can with digital
imagery, animation, or digital video. Generally, there are three primary “sweet spots” of digital audio
support, across all Android devices, that you should target for support for your high-quality audio.
Lower-quality audio, such as narration tracks, or short sound effects, can use a 22kHZ or 32kHz
sampling rate with 8-bit, 12-bit, or 16-bit sampling resolution. The high-quality audio targets include
CD-quality audio, also known as 16-bit data sampling at 44.1kHz. HD-quality audio is at the other
end of this high-end audio spectrum, using a 24-bit data sampling resolution and a 48kHz audio
data sampling rate. There is also an unnamed “somewhere in the middle” specification, using 16-bit
data sampling at a 48kHz sampling rate, which is what THX used to use in movie theaters.
Ultimately, however, it comes down to the quality-to-file-size results that emerge from your digital
audio data footprint optimization process, which can yield some amazing results.