Mute 3d sound at start

Hi All,

How do I mute the 3d sounds in my world for the first 3 seconds of the game starting?


What about setting the volume to 0?

for manager in base.sfxManagerList:

def unmute(task):
  for manager in base.sfxManagerList:
  return task.done

taskMgr.doMethodLater(3.0, unmute, "blah")


Does it matter where I place that code in my program? I can still hear about .5 seconds of my 3d sounds right when the game starts.


just don’t call your play method for the first 3 seconds.
those usually look like: , base.playSfx(sound) or base.playMusic(music). Put all of those inside a method you call later.

also there are the methods disableAllAudio() and enableAllAudio() in base (see direct/src/showbase/ or from python help(base) / help(direct.directbase.ShowBase))

ah wait. you want to mute them, not pause. well then you must set the volume to 0, just as pro-rsoft said. you also can do it before actually playing the sounds