Game Development Reference
In-Depth Information
Managing the Music and
Sound Effects
In this chapter, you will learn how to manage your music and sound effects. LibGDX
provides you with four interfaces to handle different types of audio data. The first
two interfaces that we will discuss are targeted at playing back prerecorded audio
files. The two remaining interfaces give us even more low-level access to the audio
device. They can be used to record and play back raw samples of audio data, which
is a so-called Pulse Code Modulation ( PCM ) encoded audio signal. Next, we will
take a look at the great world of sound generators. These tools are extremely handy
as they allow you to quickly create new sound effects in a short period of time.
Lastly, looping background music and some sound effects for certain in-game events
will be added to Canyon Bunny. The game's audio settings can be changed in the
options menu of the menu screen through two new checkboxes and sliders for music
and sound effects.
Playing back the music and sound
effects
LibGDX provides cross-platform audio playback for prerecorded audio files of the
following three supported file formats:
.wav (RIFF WAVE)
.mp3 (MPEG-2 Audio Layer III)
.ogg (Ogg Vorbis)
Search WWH ::




Custom Search