O'Reilly logo

Panda3D 1.6 Game Engine by Dave Mathews

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding music

The first thing we'll do is add some background music to our game. Before we do, though, let's talk a little about audio in Panda3D.

The audio system in Panda3D is not the strongest feature of the engine. There are numerous ways to load audio files, and several of the commands can be quite confusing. Even so, it's pretty easy to get the hang of using it. To start with, we'll talk about the two pieces of the audio system:

  • AudioSound Objects: Objects that contain individual sounds
  • AudioManager Objects: Objects that group multiple sounds together

AudioSound objects

AudioSound is the class that contains a specific sound file. An instance of this class is returned when a sound file is loaded. That's really all there is to it. Here are the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required