Pro Java 9 Games Development Leveraging the JavaFX APIs

(Michael S) #1

Chapter 21 ■ Questions and answers: Finishing the setup Methods and digital audio


We will now create a medium and low-quality digital audio asset by reducing the sample rate from
44.1 KHz to 22.05 Hz (exactly half ). Reducing the data by 100 percent (half ) or 200 percent (quarter) gives
perfect results as there are no remainder values (even division). To do this, use the Project Rate (Hz) drop-
down selector at the bottom of the track editing pane and select 22050 instead of 44100, as shown circled in
red on the left side of Figure 21-31. You can also see that the resolution has been reduced to 16-bit. Preview
the digital audio to see whether you can hear any difference in audio quality using the Play button at the top
left of the Audacity user interface, also circled in red. It still sounds great as an effect.


Finally, let’s reduce this sound effect sample by another 100 percent by taking its sample rate down to
11.025 KHz, from 44.1 KHz (always sample from the highest possible sample rate to a target sample rate to
give the algorithm the highest-quality data to work its magic with). As you can see in Figure 21-32, we have
Audacity using a 44.1 KHz, 16-bit audio sample data (see the setting on middle left) and have set the Project
Rate (Hz) drop-down to 11.025 KHz. You could again preview the audio quality, using the Play button, and
if you do, you will see that the quality level has gone down, but the quality level is still quite usable for a
repetitive game board spin animation audio feedback sound effect.


Figure 21-31. Reduce the sample format by another 100 percent, from 44.1 to 22.05 KHz using the Project Rate
drop-down menu


Figure 21-30. Reduce the sample format another 100 percent from 32-bit to 16-bit resolution using the sample
drop-down arrow

Free download pdf