28.04.2019 Views

[JAVA][Beginning Java 8 Games Development]

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

Audio Sample Resolution and Frequency: Optimizing for Your Memory Footprint<br />

The first step in the memory data footprint reduction process will be to take the raw 32-bit data sampling rate and<br />

reduce that by 100%, from 32-bit floating point data to 16-bit PCM data, as is shown in Figure 15-5 on the bottom left<br />

of the screenshot. Find the drop-down arrow in the gray information panel on the left side of the Audacity sample<br />

editing area, which I have circled in red in this screenshot as it is kind of difficult to find if you are not used to using it.<br />

This will give you a menu that allows you to set the data display (Waveform or Spectrogram) and set your Sample Data<br />

Format, which is the submenu that we want to use to select the 16-bit PCM option rather than the 32-bit float option.<br />

Do not set your sample rate using this menu, as it will slow down your voice (you can try this if you want to use this as<br />

a special effect later on). Next, we will be looking at the correct work process for setting the sample rate.<br />

Figure 15-5. Click the drop-down menu arrow at the left and select the Set Sample Format ➤ 16-bit PCM setting option<br />

It is important to note that if you save your file out after making this data bit-level change, your file size will not<br />

have changed! As you may have noticed, the Export File dialog is saving your file in 16-bit PCM WAVE format, so it is<br />

doing this same adjustment that you are doing here in memory, for your file size on disk. I am simply including this<br />

step here so that you get a comprehensive overview of the entire process, starting with a sample data rate reduction,<br />

and then reducing the sample frequency rate, which we are going to do next, and finally addressing the stereo versus<br />

mono sample consideration, which will be our final step later on in this section of the chapter.<br />

Each of these “optimization moves” can reduce the file size (and memory footprint) by 100% or more, upon each<br />

application of the work process. In fact, when we reduce the sampling frequency next from 44,100 to 11,025 we will be<br />

reducing the data footprint by 200% (100% from 44,100 to 22,050, and then 100% from 22,050 to 11,025).<br />

328<br />

www.it-ebooks.info

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

Saved successfully!

Ooh no, something went wrong!