CHAPTER 12: Digital Audio: Providing Aural Feedback for UI Designs Using SoundPool 455
If you look at the buttonaudio.wav 16-bit PCM Wave file that you just saved out, you will see that
the file size, at 219KB, is about half as large the original button_sound_effect.wav file, which was
393KB. So, our baseline uncompressed data footprint for this 1.15-second button sound effect
sample is 219KB. We can use this number to determine the amount of compression that we’ll be
getting with all these Android digital audio file formats.
Exporting via Lossless FLAC: FLAC audio files
The first format I am going to try out is the FLAC audio codec, because it uses lossless
compression. This will give us a good idea of what kind of data footprint reduction we can get using
compression which does not throw away any of the original audio data, and this will give us as
perfect a result as the 16-bit PCM Wave audio does!
To do this, we’ll again use the File ➤ Export menu sequence, and this time we will drop-down
the Save as type menu and select the FLAC Files format, as is shown in Figure 12-9. Again, we
will name the file buttonaudio, and I am going to save it into my CH12 folder for this book. Notice
that there are no other files listed within the center area of this dialog; this is because now that we
have selected the FLAC file format, this file save dialog region is now showing only FLAC files, and
currently, there are none in the CH12 folder.
Figure 12-9. Export a FLAC file named buttonaudio.flac with Level 8 (best) quality and a 16-bit sample resolution
To set our FLAC codec options, click on the Options button and set the quality level to 8 (best)
and the Bit depth to 16-bit. Note under the Bit depth drop-down that we can also use FLAC for a
lossless 24-bit HD audio.
Once you’ve output your buttonaudio.flac audio asset, go into the file manager and take a look at
the file size. You will see that it is 106KB, or reduced by over 100% (106 divided by 219 is 0.484, or
less than half as large).
Next, let’s take a look at the other open source format, Ogg Vorbis, to see if it can give us an even
smaller data footprint. Since Ogg Vorbis is a lossy file format, it should give us an even smaller file
size than the FLAC did.