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

Time for action - generating 3D audio with Audio3DManager

Are we ready to see how this works? Let's go, then!

  1. Open RaceClass_00.py from the Chapter11 folder.
  2. We'll start with two new imports. AudioManager object is in the pandac.PandaModules package, but Audio3DManager object is in the direct.showbase package.
    from pandac.PandaModules import *
    from direct.showbase import Audio3DManager
    
  3. Next, we're going to add a nice block of code to the __init__ method to set up our AudioManager objects and their wrappers:
    self.amList = [] self.a3DList = [] for N in range(4): self.amList.append(AudioManager.createAudioManager()) base.addSfxManager(self.amList[N]) self.audio3D.append(Audio3DManager.Audio3DManager( base.sfxManagerList[N + 1], camera)) self.a3DList[N].setDropOffFactor(.1) ...

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