Pro Java 9 Games Development Leveraging the JavaFX APIs

(Michael S) #1

Chapter 2 ■ an IntroduCtIon to Content CreatIon: 2d new MedIa asset FundaMentals


similarities between digital images (and video) and digital audio that will carry through into your digital new
media content production, as you will soon see.
The volume of a sound wave will be determined by the amplitude of the sound wave or the height
(or size) of that wave. Thus, frequency of sound waves equates to how closely together the waves are
spaced, along the x-axis, if you are looking at it in 2D, and the amplitude equates to how tall the waves are,
as measured along the y-axis.
Sound waves can be uniquely shaped, allowing sound waves to “piggyback” various sound effects.
A “pure,” or baseline, type of sound wave is called a sine wave, which you learned about in high school
trigonometry, using the sine, cosine, and tangent math functions. Those of you who are familiar with audio
synthesis are aware that there are other types of sound waves that are utilized in sound design, such as the
saw wave that looks like the edge of a saw (hence its name) or the pulse wave that is shaped using only right
angles, resulting in immediate on and off sounds that translate into pulses (or bursts) of synthesized digital
audio.
Even randomized waveforms, such as noise, are used in sound design to obtain “edgy” sound results.
As you may have ascertained by using your recently acquired knowledge regarding data footprint
optimization, the more “chaos” or noise that is present in the sound waves (and in new media data in
general), the harder they will be to compress for a codec. Therefore, more complex sound waves will result in
larger digital audio file sizes because of the chaos in the data.


Converting Analog Audio to Digital Audio Data: Sampling, Accuracy,


and HD Audio


The process of turning analog audio (sound waves) into digital audio data is called sampling. If you work in
the music industry, you have probably heard about a type of keyboard (or even rack-mount equipment) that
is called a sampler. Sampling is the process of slicing an analog audio wave into segments so that you can
store the shape of the wave as digital audio data using a digital audio format. This turns an infinitely accurate
analog sound wave into a discreet amount of digital data, that is, into zeroes and ones. The more zeroes and
ones used, the more accurate the reproduction of the infinitely accurate (original) analog sound wave. Each
digital segment of a sampled audio sound wave is called a sample, because it samples that sound wave at
that exact point in time. The sample accuracy determines how many zeroes and ones are used to reproduce
analog sound waves, so the precision of a sample is determined by how much data is used to define each
wave slice’s height. Figure 2-7 shows a button sound effect that I sampled using Audacity, using a 32-bit float
sample accuracy and a 48 kHz sampling rate, which we will cover next.

Free download pdf