Hello !

Today I tried the 3D Sound functions but I don’t hear a volume
difference when moving away from the sound source.

My camera system is right handed (OpenGL) so as mentioned
in the tutorial I negate the y and the z axis (also tried to only
negate the z axis).

I tested it by moving the camera from (0,0,0) away to (0,0,10)
or (0,0,-10) with MaxDistance set to 10.0f but the volume of
the channel does not change when moving away although the
the camera is setup correctly ๐Ÿ˜•

What I’m doing wrong ? ๐Ÿ˜ณ

[b:2xgc5eex]Here is my init code :[/b:2xgc5eex]
[code:2xgc5eex]int Channel= FSOUND_PlaySound(FSOUND_FREE, Sound[0]);
FSOUND_SetVolume(Channel, 255);
FSOUND_3D_SetAttributes(Channel, VECTOR_ZERO, NULL); // Position the sound source at (0,0,0)
FSOUND_3D_SetMinMaxDistance(Channel, 0.1f, 10.0f);[/code:2xgc5eex]

[b:2xgc5eex]And my main loop code :[/b:2xgc5eex]


Vector<float> Forward= Cam::ActiveCam.GetForward();
Vector<float> Upward = Cam::ActiveCam.GetUpward();
FSOUND_3D_Listener_SetAttributes(Cam::ActiveCam.GetPosition().Vector, NULL, Forward.Vector[0], Forward.Vector[1], -Forward.Vector[2], Upward.Vector[0], Upward.Vector[1], -Upward.Vector[2]);


} while (...);[/code:2xgc5eex]

I only have an onboard soundchip and don’t know if he supports hardware
channels so I also have this line before the FMOD_Init stuff :

[code:2xgc5eex]signed char res= FSOUND_SetMinHardwareChannels(4);[/code:2xgc5eex]

My units are same as the default fmod units (1.0f = 1 meter).

Btw what happens when everything is done in software, does this still
produce hearable volume differences when moving away from the
sound source or is it just not accelerated ?

Thanks for help ! :)

  • You must to post comments

Yes I set it to 10.0f cause I’m only moving in the range of 0.0f to 10.0f (for testing)

  • You must to post comments

I made a debug on the vectors…the upvector is always (0,1,0) and the
forward always (0,0,-1) as it should be cause I’m only moving on the
z-axis (for testing) and don’t change the camera direction.

I really don’t know what remains to search for errors :(

  • You must to post comments

I got some news on this problem. If I save the same wav files as
mono instead of stereo, it works ! ๐Ÿ˜ฎ

Are the standard windows wav files not supported in stereo ?
Why does it only work with mono wav files ? ๐Ÿ˜ณ

  • You must to post comments

Another thing is, when I use DirectSound instead Windows Multimedia
Waveout I can’t even hear a sound loaded with the FSOUND_HW3D flag ๐Ÿ˜•

So two things does not work here :

  1. Windows Multimedia Waveout + FSOUND_HW3D + stereo wav [b:2zpu0iqu]=[/b:2zpu0iqu]
    no 3d sound effect. With mono wav I can hear the 3d sound effect.

  2. DirectSound + FSOUND_HW3D + any wav [b:2zpu0iqu]=[/b:2zpu0iqu] no sound, 100% silence

Any ideas ? ๐Ÿ˜ณ
thank you ! :)

  • You must to post comments

Oh sorry I just read some old threads and I think I found the answer.
Stereo is not meant to be played in 3D space, it doesn’t make sense right?
So I have to convert the wav files that I want to be in 3D space from stereo to mono… :)

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.