28.04.2019 Views

[JAVA][Beginning Java 8 Games Development]

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 15 ■ Implementing Game Audio Assets: Using the <strong>Java</strong>FX AudioClip Class Audio Sequencing Engine<br />

Setting the Audio Sample Frequency: Reducing Your Memory Data Footprint by<br />

Another 200%<br />

The proper way to set the digital audio sampling frequency for your project in Audacity is to use the drop-down<br />

dialog for the project’s sample frequency setting. This can be seen in the lower left corner of Figure 15-6, highlighted<br />

inside of a red box. Select the 11025 frequency setting, which reduces the audio data (think of these as vertical slices<br />

of the sound wave) sampling rate from 44,100 times per second, to 11,025 data slices per second, or a 4X reduction in<br />

audio data sampled in the first place, which is a 200% reduction in data footprint due to this sample frequency step in<br />

the data (in this case, you should look at this as memory used, more than file space used) optimization work process.<br />

Figure 15-6. Reduce audio sampling frequency by four times by reducing it from 44100 per second to 11025 per second<br />

You can play around with these seven different settings, between the 44,100 and 8000 sample frequency rates, as<br />

each of them will have a different quality level, with 8000 being too low of a quality to use for voice samples, but which<br />

might work well with a “dirty” or “noisy” sound, such as an explosion.<br />

If you want to hear what these different settings sound like, after you select each one of course, click on the<br />

green play (right facing triangle) in the audio transport buttons shown at the top-left of Figure 15-6. You will see that<br />

the 32,000 frequency sounds just like the 44,100 frequency rate, as does the 22,050 frequency. The 16,000 or 11,025<br />

frequency rates do not sound as “bright” but are still usable, so I used the 11,025 rate, to get an even 4X downsample<br />

of the data. This is because downsampling by an even 2X (100%) or 4X (200%) will always provide the best result. This<br />

is because of the math involved leaving no “partial” samples (or pixels, since the same concept applies with imaging).<br />

www.it-ebooks.info<br />

329

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!