I’ve been getting this sharp transition in volume when using the set3DPanLevel, and have observed the following behaviour in-game. If I have some streaming audio positioned at same location as listener, and call set3DPanLevel(0.0f) and set3DPanLevel(0.01f), there is a noticeable difference in volume coming out the left speaker (perhaps 1 dB?). There is no change in the right speaker. I have a configuration where it keeps alternating between these pan levels on a 0.5 second cycle, with no other properties changing.
I’ve tried for ages to reproduce this problem in FMOD Designer and the FMOD examples, but have been unable to do so (no volume difference). Can anyone suggest what could be causing this artefact? It’s driving me nuts.. I’ll get to the bottom of it eventually, continuing to strip down our game runtime until it matches the FMOD example precisely, but that could take a while.
- Jade_Lee asked 11 years ago
I am convinced this issue has something to do with either the encoding of the streaming data (format), or the fact we’re using a subsound (through use of getSubSound). If I create a stream directly from a wave file using createStream, everything works fine. If I instead create a stream from an FSB file, and use getSubSound to acquire the child stream, it suddenly has this attenuation issue. Should set3DPanLevel behave differently for different wave formats (or subsounds)?
If I query getFormat on the two sounds that are responding differently to set3DPanLevel, they have the same format (PCM16) and number of channels (1), only difference is one is AIFF and the other is FSB.
OK, I can now reproduce it in FMOD samples. Load up the fsb sample project, change it to compile the main.cpp (properties..’excluded from build’ set to No), instead of main.c (exclude from build) and add in the following..
Before the main do loop, add in a state
[code:htum4bhy]bool panLevelToggle = false;[/code:htum4bhy]
Then within khhit() condition, at end of this conditional block add
if (key == ‘ ‘)
panLevelToggle = !panLevelToggle;
Then the line before the system->update() call add the block
result = channel->set3DPanLevel(0.0f);
result = channel->set3DPanLevel(0.01f);
Now if you run this sample (choose to play back sample ‘2’), and hold down the space bar (causing it to toggle back and forth between pan levels), you should be able to clearly hear the issue I’ve discussed above. If you hit space once off, it’s a bit harder to notice, but certain sound samples make the change more pronounced. It would appear that high frequency tones are being affected (background ‘hiss’ is toggling on and off).
I tested the above with latest stable branch 4.06.08.
Please login first to submit.