Let's make some noise

So far, across all the games we have made, we can note that they all have something in common. They are completely silent! As any good game-maker knows, sounds and music add an awful lot to the experience. What we are going to look at now is how to use LibGDX to introduce sounds to our simple platform.

Before we dive into coding up some beeps and boops, let's first look at how LibGDX handles making sounds!

Sound effects

LibGDX splits the handling of audio into two parts. The first part is the sound effects with smaller audio files and the second part is the music, which generally has larger audio files. We will start off with looking at the Sound class of LibGDX, the one that looks after the smaller sound effects.

According to ...

Get LibGDX Game Development By Example now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.