I’m currently working on a synthetic sound source I implemented as DSP and now I want it to be positioned in 3d. I’m calling system->playDSP() and then I set the channel mode to FMOD_3D (just as in http://126.96.36.199/forum/viewtopic.php?t=10591).
The result is, that the amplitude of the sound changes with it’s position, but not the speaker position — it is always centered. At the same time I’m playing some regular sounds which are positioned correctly.
Anyone who knows what I’m doing wrong?
Thanks in advance,
- lenzoi asked 8 years ago
Did you setup a listener and are you updating it every frame? Also Min/Max distance needs to be set right or it will make funny things happen. I am not sure that this explains the mono effect but make sure it’s all setup correctly and go from there.
- bmantzey answered 8 years ago
Currently I’m just using the default listener at (0, 0, 0). But I tried to set up a listener explicitely and update it every frame without any changes. For test purposes, I even tried moving the listener instead of the sound sources, but the result was the same.
Thanks for your reply. Yes, the listener’s forward vector is the positive z-axis, and it’s up vector is the positive y-axis. Position and velocity are both a null vector. I think this matches with the default settings, so it wouldn’t be necessary to set these parameters. Anyway, what’s strange to me is that the positioning works fine for a normal sound, but not for the DSP.
I create the DSP with
memset(&dspdesc, 0, sizeof(FMOD_DSP_DESCRIPTION));
strcpy(dspdesc.name, "Sine DSP");
dspdesc.channels = 0;
dspdesc.read = createSine;
system->playDSP(FMOD_CHANNEL_FREE, sineDsp, false, &dspChannel);
and then every frame I call
createSine() — as the name suggests — does nothing else but creating a simple sine wave.
Thank you, that solved my problem. The documentation says, that the number of output channels is equal to the number of input channels, if [i:2x3p48xr]channels[/i:2x3p48xr] is set to 0. In the case of a sound source, this doesn’t make sense as there is no input. 😳 So, for some reason, the DSP still worked, but the positioning failed because of this value, I guess.
Please login first to submit.