Game Development Reference
In-Depth Information
sounds just like the 44,100 frequency rate, as does the 22,050 frequency. The 16,000 or
11,025 frequency rates do not sound as “bright” but are still usable, so I used the
11,025 rate, to get an even 4X downsample of the data. This is because downsampling
by an even 2X (100%) or 4X (200%) will always provide the best result. This is be-
cause of the math involved leaving no “partial” samples (or pixels, since the same
concept applies with imaging).
Next, let's use the File Export work process. If you want to see this on a menu,
this menu sequence can be seen in Figure 15-1 , and is shown on the File menu, above
Export Selection option. In the Export File dialog, which can be seen in Figure 15-7 ,
you can save the new version of the file using a different file name , so that you have
both the original uncompressed data in the left.wav file and the new compressed (ste-
reo) data in the leftstereo.wav file. Name this file leftstereo , and click on the Save but-
ton, to save it as an uncompressed 16-bit PCM WAV file, as shown on the left side of
Figure 15-7 .
Figure 15-7 . Use the File
Export dialog, name the file leftstereo, Save the file, then use File
Open to check
its file size
The next thing that we will want to do is use the same work process shown back in
Figure 15-3 , and use the File Open menu sequence, to open the Select one or
more audio files dialog, shown on the right side of Figure 15-7 , which will allow us to
mouse-over the leftstereo.wav file and see that the size is 28.0 KB , which is four times
less data than the original 112 KB source file size, just as we expected!
Therefore, we've reduced our memory requirements for this audio file that states
the word “left” from one-ninth of a megabyte (112 KB), to one-thirty-sixth of a mega-
byte (28KB). This means that you can have 36 audio assets of this size, and still be us-
ing only one single megabyte of system memory! When I created the other five audio
assets, this one turned out to be the largest, and the smallest (up and s, as you may have
guessed) were less than 4KB each!
 
 
Search WWH ::




Custom Search