0
0

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://52.88.2.202/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

  • You must to post comments
0
0

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.

  • You must to post comments
0
0

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.

  • You must to post comments
0
0

You’re probably updating the listener incorrectly. Do you have the up and forward vectors correct , unit length and perpendicular?

  • You must to post comments
0
0

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
[code:1mek3joj]FMOD_DSP_DESCRIPTION dspdesc;
memset(&dspdesc, 0, sizeof(FMOD_DSP_DESCRIPTION));
strcpy(dspdesc.name, "Sine DSP");
dspdesc.channels = 0;
dspdesc.read = createSine;
system->createDSP(&dspdesc, &sineDsp);

system->playDSP(FMOD_CHANNEL_FREE, sineDsp, false, &dspChannel);
dspChannel->setMode(FMOD_3D);[/code:1mek3joj]

and then every frame I call
[code:1mek3joj]dspChannel->set3DAttributes(&pos, &vel);[/code:1mek3joj]

createSine() — as the name suggests — does nothing else but creating a simple sine wave.

  • You must to post comments
0
0

I do not understand this line:

dspdesc.channels = 0;

Shouldn’t you set it to 1 ?

  • You must to post comments
0
0

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.

  • You must to post comments
Showing 6 results
Your Answer

Please first to submit.