I’m having trouble getting positional 3D working for a streaming file.
Basically, using FSOUND_Stream_Open, FSOUND_Stream_Play (using FSOUND_FREE) and FSOUND_3D_SetAttributes, the sound is only ever heard from 0,0,0. It is not moving, so the pos/vel is only set once. Both functions return true, and no FMOD errors of any kind are logged.
Mode flags I use are FSOUND_FORCEMONO (though the file is mono already) and FSOUND_HW3D.
If I check the sound’s position later (using FSOUND_3D_GetAttributes) while it’s playing, it returns the correct position (i.e. the one I set).
However, the sound is clearly heard emitting from 0,0,0.
I am also sure the listener position is being set correctly, as other sounds are heard from the correct positions.
The file is also an OGG. I did try converting it to MP3 to see if that would fix the problem, but it didn’t. Other OGGs play fine in 3D.
The file is quite large (~44 Mb) which is why I’m streaming. Most (but not all) of the other 3D sounds are pre-loaded as samples.
- Bren asked 10 years ago
Ack. Apologies. Turns out this was a content problem, and the parenting of the sound emitter in the scene graph was resulting in the wrong position being read by the yadda yadda yadda blah blah blah.
Anyway, it’s fixed now. Thanks a lot for the help.
[quote="brett":3jsze5jm]Maybe your min/max values are too large/small. Have you set them appropriately[/quote:3jsze5jm]
I had the min/max set to 2.5 (my value) and 1000000000.0f (FMOD default, according to docs). I tried removing the call to FSOUND_3D_SetMinMaxDistance (to leave it at default) but that has made no difference.
[quote="brett":3jsze5jm]have you tried simply replacing the sound in the ‘3d’ example with a stream instead of a sample, it should work.[/quote:3jsze5jm]
Not sure what you mean. The problem file IS being played as a stream, not a sample. I have other 3D samples and streams playing fine.
I tried to play the problem file as a preloaded sample, but FSOUND_Sample_Load returned null, and the FMOD_ERR_CREATEBUFFER error was logged (possibly the file is too big?).
Please login first to submit.