Hi All,
How do I mute the 3d sounds in my world for the first 3 seconds of the game starting?
Thanks,
Kory
Hi All,
How do I mute the 3d sounds in my world for the first 3 seconds of the game starting?
Thanks,
Kory
What about setting the volume to 0?
for manager in base.sfxManagerList:
manager.setVolume(0.0)
def unmute(task):
for manager in base.sfxManagerList:
manager.setVolume(1.0)
return task.done
taskMgr.doMethodLater(3.0, unmute, "blah")
pro,
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.
Thanks,
Kory
just don’t call your play method for the first 3 seconds.
those usually look like: sound.play() , 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/ShowBase.py 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