654 APPENDIX A: Audio Concepts, Terminology, and Codecs
Lower sampling rates, such as 8kHz, 22kHz, and 32kHz, are optimal for sampling any “voice-based”
digital audio, such as a movie dialog or ebook narration track, for instance. Higher audio sample rates
are more appropriate for music and other sound effects such as rumbling thunder, which needs a high
dynamic range (high fidelity). High sample rates are best for movie theater (THX) sound quality.
Some sound effects, such as the ones that you will use in your HelloUniverse app, can get away
with using a lower 22kHz or 32kHz sampling rate, as long as the sampling resolution used is 16-bit
quality. Ultimately, you will have to use your ears during the digital audio optimization process to
ascertain the quality-to-file-size trade-off.
Digital Audio Attributes: HD, Stream, and Bit Rate
As mentioned, an industry “baseline” for superior audio quality is known as CD-quality audio and it
is defined as a 16-bit data sample resolution at a 44.1kHz data sample frequency. This was used to
produce audio CD products way back in the 20th Century, and it is still used as a minimum quality
standard today. There is also the more recent HD audio standard, which uses a 24-bit data
sample at a 48kHz or 96kHz sample frequency. This is used today in HD radio as well as in HD
audio-compatible Android devices such as “Hi-Fi” HD audio smartphones.
If you are going to use HD audio in your Android applications, you need to make sure that your
target users will own the HD audio-compatible hardware that will be required to utilize a higher level
of audio fidelity. Just like with digital video data, digital audio data can either be captive within the
application, with data files in the /raw folder, or digital audio can be streamed using remote data
servers. Similar to digital video, the upside to streaming digital audio data is that it can reduce the
data footprint of the application, just as streaming digital video data can. The downside is reliability.
Many of the same concepts apply equally well to digital audio and digital video assets.
Streaming audio will shrink the size of your application’s data footprint, because you do not have to
include all of that heavy new media digital audio data inside of your .APK files, so if you are planning
on coding a digital Jukebox application, you may want to consider streaming your digital audio data.
Otherwise, try to optimize your digital audio data so that you can include it (captive) inside the .APK
file. This way, digital audio will always be available to your application’s users when they need to play it.
The downside to streaming digital audio is that if your user’s connection (or the audio server) goes
down, your audio file may not be available for your users to play and listen to! The reliability and
availability of your digital audio data is the key factor to be considered on the other side of this
streaming audio versus captive digital audio data trade-off. The same trade-offs which are discussed
in this book for digital video assets can also be applied to digital audio assets.
Just like with digital video, one of the primary concepts in regards to streaming your digital audio
is the bit rate of that digital audio data. As you learned in Chapter 11, the bit rate is defined during
your compression process. As with digital video, digital audio files that need to support lower bit rate
are going to have more compression applied to the data, which will result in a lower quality level.
These lower bit-rate files will play back smoothly across a greater number of devices, because
fewer bits can be processed (and transferred) more easily. As a processor gets faster, it can process
more bits per second. As a data bandwidth connection gets faster, it can more comfortably send or
receive more bits per second as well.