Hi, I’m playing with FMOD on Windows. I’ve made a little demo of 3d audio using a DSP oscillator as the sound source, in my demo I can position both the listener and the sound source in 3d space.
The 3d effect is working quite well in that the volume of the sound is reduced as the distance between the listener and the sound source increases (works in all 3 directions and in combination). However, the sound is always mono, with the same volume coming from each speaker. I had thought that when the sound was to the left of the listener, the sound would be louder in the left speaker and quieter in the right speaker, and vice versa.
I’m thinking this problem could be overcome by having two listeners, one for each stereo speaker, but maybe I’ve done something wrong?
Any ideas would be appreciated.
- coolguy4 asked 7 years ago
Shot in the dark here… Reading your post. I assume you did not get head phones right?
Get them headphones…
Default fading is logaritmic (<-spl) so, in combination with the default min max distance and the distance to the listener and no headphones, you may not realize it works.
You can set the fading to linear, and change the min max to 10, 600 since you play at 500 distance max. you should hear the difference then.
He said the 3D example is working for him, so I don’t think that is an issue. I would advise you build up one of the FMOD examples until it reproduces the issue. Usually the process of doing that will reveal the problem. Maybe start with the simple_event example and build that up. It’s also worth double checking the issue isn’t in your data by auditioning the events in Designer using the "Audition 3D" window.
[quote:s5jp78eg]I had thought that when the sound was to the left of the listener, the sound would be louder in the left speaker and quieter in the right speaker, and vice versa. [/quote:s5jp78eg]
Yes it should be that way. You don’t need to set up multiple listeners, it should just work. Try running the [b:s5jp78eg]3d[/b:s5jp78eg] example that ships with the API, and let us know if the sounds are panning to the left and right correctly.
My forward vectors are ok, I’m using the same vectors as in the demo.
I tried the demo again and realised that with my desktop speakers I really can’t judge the stereo panning accurately.
Is there a way to check the output on a per speaker basis? Channel::getAudibility is great but it only gives an overall value. If not then I guess I should track down some good headphones.
Yes, get headphones and make sure they work. I had a bad headphone with bad wires, everthing was mono and mislead me in the wrong direction, debugging code that was working.
if your up vector is also all 0s, you will also only perceive distance (at least in my setup)
Thanks for the reply.
I realised that I could use System::setOutput to have the audio output to a wav file instead of playing through the speakers. I was then able to open the wav file in Audacity and I could clearly see that both left and right channels were identical.
When I did the same to the 3d example, I could clearly see that when the listener moved to the left of the sound, the sound was in the right channel, and when the listener moved to the right of the sound, the sound was in the left channel.
So I was doing something wrong!! What, though, I don’t know.
I have since moved on to using the EventSystem. I created a simple demo and hoped that somehow it would work when using Events when it hadn’t worked the other way. Well, turns out I was wrong! (There is no setoutput for events, but now that I know what to listen for I can check by holding the speakers to my ears.)
I was hoping someone could have a quick look at my code, linked below. This program creates a slider to control the listener’s position in the x-dimension. When I run it, the sound volume changes as the position changes; the sound gets softer the greater the distance between the listener and the event, but the volume is equal on both left and right channels.
Any thoughts would be much appreciated!
Please login first to submit.