Is there a way to set a “master volume” that will affect all the sounds playing, rather than modify the volume of each sound?
What if I want to have separate volume sliders for “sfx”, “music” and “GUI sounds”? I thought of making 3 parents and changing their volume instead, but I dont see any child-parent relations for sound effects.
By default, ShowBase creates one AudioManager for music and stores it in base.musicManager. It also creates one AudioManager for sound effects and stores it in base.sfxManagerList[0], with room for more in case you want more. The theory is that you might want multiple sfx managers, but probably only one music manager. Of course, that’s really up to you; you can use any of these AudioManagers for whatever purpose you like. And you can create another one of them with a call AudioManager.createAudioManager(), as many times as you like.
Use loader.loadSound() to load a sound with the AudioManager of your choice, specified as the first parameter. Note that loader.loadSfx() maps to loader.loadSound() with base.sfxManagerList[0] as the first parameter, and loader.loadMusic() maps to loader.loadSound() with base.musicManager as the first parameter.
All of this information can be readily gleaned by examining ShowBase.py.
I don’t know. That does sound weird. Which sound API are you using, FMod or OpenAL? Have you tried switching to the other one, to see if it might be a bug in that particular sound interface?
Youre right, its a bug when using FMOD.
But OpenAL has loads of other bugs, ‘clipping’, framerate drops and complete python crash, so I would like to see this fixed.
(using Windows7 and latest builds)
I actually fixed this some time ago, but I don’t think it ever got integrated.
Here are my FMOD source files, they are based on the SVN source from Sept. 4th. http://novuscom.net/~spacebullet/audiotraits.zip
This allows separate volume control on each AudioManager, as well as separate DSP effects.
Some day I will rewrite that nasty DSP system.
OK, committed your changes. I’ll take your word for it that it works.
Next time, consider posting a patch instead of posting a zipfile. That makes it much easier to apply. Also, the files you sent had DOS newlines instead of UNIX newlines.
It was a while ago when I did it and I’ve made a new repository since then so the history was gone.
Most of those files probably weren’t even modified, sorry about that.
The newlines, well that’s just how they are over here.