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 />

Creating and Optimizing Digital Audio: Audacity 2.0.6<br />

Launch the latest version of Audacity—at the time of this writing that would be 2.0.6, and use your microphone to<br />

record your voice saying the word “left.” Fortunately my NetBeans 8 and <strong>Java</strong> 8 development workstation is also my<br />

Skype workstation, and I have a basic Logitech adjustable microphone on a stand that I can use to make the basic<br />

audio files that we will need to put audio files into place for each of our different sprite movements that we put into<br />

place in Chapter 13. I will go through the digital audio file “scratch creation” and optimization work process in this<br />

section of the chapter, and you can do this yourself, for each of the six digital audio files we will need to use in the<br />

coding sections of this chapter. You can also use the six audio files included with this book’s software repository if you<br />

want to simply get onto the <strong>Java</strong> 8 coding part of digital audio asset implementation using the <strong>Java</strong>FX AudioClip class.<br />

I would recommend going over how to optimize uncompressed audio for use in system memory, as we’re about to<br />

take 113KB of raw source audio data, and knock 99KB of data off of it, and reduce it another 88% to be only 14KB.<br />

As you can see in the left side of Figure 15-1, I have recorded the spoken word “left,” and used the Audacity<br />

selection tool to select only that portion of the recording session, seen in a darker gray shade, that contains the audio<br />

data. Since you can see the digital audio waveform representation in the Audacity waveform editing area, you can see<br />

the portion of your recording where the data that you just recorded is contained. The portion of your audio recording<br />

that does not contain any digital audio data will just look like a straight line.<br />

Figure 15-1. Launch Audacity, record your voice saying the word “left,” and then select the wave and Export Selection<br />

The fastest way to get only the raw digital audio data, which is all that we really want inside of our .WAV file<br />

anyway, and is the only data that we want to be optimizing using Audacity, is to use the File ➤ Export Selection menu<br />

sequence. This will allow us to directly write the selected audio data into the left.wav file using the WAVE PCM digital<br />

audio format. After we do this, we can then start a new Audacity editing session and simply open up that file and start<br />

the digital audio content optimization process.<br />

After you use the Export Selection menu option in Audacity, you will get the Export File dialog, which is shown<br />

in Figure 15-2. Type left in the File name: field, seen in the bottom of the dialog, and click the Save button.<br />

www.it-ebooks.info<br />

325

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

Saved successfully!

Ooh no, something went wrong!