Game Development Community

Audio Emitter Volume Resetting

by Paul Teall · in Technical Issues · 09/07/2007 (9:15 am) · 3 replies

Hey all -

I've been messing with audio emitters a bit, and am able to get them working. I'm having a problem with the volume level, though. I thought 1.0 was the max, but it's barely audible at this level (leaving other settings at default). When I adjust the volume while in mission editor, I hear a noticeable difference. It seems to level off at about 5.0. When I save in mission editor, close and then relaunch, the volume is back to 1.0. I've also tried changing this directly in the .mis file, no luck.

Anyone know what's going on here?

Paul

#1
09/07/2007 (9:26 am)
Take a look in game/audioEmitter.cc at AudioEmitter::onAdd():

mDescription.mVolume = mClampF(mDescription.mVolume, 0.0f, 1.0f);

It's clamping the volume when you add an AudioEmitter to the simulation.
#2
09/19/2007 (1:52 pm)
Hey Andy - thanks for the tip. I also noticed something else that seems to be resetting that I'm hoping you can shed light on:

new AudioEmitter(DoubleGeneratorRoom) {
canSaveDynamicFields = "1";
position = "277.458 49.3451 23.1586";
rotation = "1 0 0 0";
scale = "3 3 3";
useProfileDescription = "0";
fileName = "~/data/sound/misc/ambientGenerator01.ogg";
type = "0";
volume = "1";

With the type line, it defaults to 2. I changed it to 0 in mission editor and saved, and this solved my volume problem. When I got back into game, it's still saved to 0, but volume is once again quiet. If I switch it to anything and then BACK to 0, it's loud again (doing this all while in-game). Any idea what the problem might be? Again, it's saving the value, just doesn't appear to work when I exit and then re-launch the game.
#3
09/24/2007 (3:27 pm)
More strangeness - the level I'm working on is an interior-based .dif level. When I move the emitter outside of the level (in mission editor, no clip mode), it behaves exactly as it should. Even if I move the emitter back in side but my view is still outside the level in no clip mode, I can still hear it. As soon as I fly through the level geometry and am back "inside", silence.