Thanks for all of the replies! I accomplished this using Samples and .wav files but could not get the Sample_Load() to work with a .mp3 file and the FSOUND_HW3D flag. I guess I’ll try it the stream way since that seems to be what everyone was suggesting. Thanks for the help and any more information would be greatly appreciated!
Okay I am not having good results using Streams!
g_pStream = FSOUND_Stream_OpenFile(“test.wav”, FSOUND_HW3D | FSOUND_MONO | FSOUND_LOOP_NORMAL, 0);
Works but when I try it using this it does not:
g_pStream = FSOUND_Stream_OpenFile(“front.mp3”, FSOUND_HW3D | FSOUND_MONO | FSOUND_LOOP_NORMAL, 0);
The only difference in the two calls is the is the file name. I get the error message “Error creating hardware sound buffer.”. Can I still use the 3D positional features of FMOD without a hardware 3D sound buffer?
WAV Stats –
Audio Sample Rate:11kHz
MP3 Stats –
Audio Sample Rate:44kHz
This is my init call:
FSOUND_Init(44100, 128, 0)
Is there anything I am doing wrong? Thanks for any suggestions/tips/help!
As stated on the front page, since DirectX 8 it is not possible to play stereo files in 3D mode anymore. The difference between your wav and your mp3 is your wav is mono and your mp3 is stereo.
If you use fmod v3.4 you can kind of overcome this problem by adding the FSOUND_FORCEMONO flag, which converts stereo streams to mono. It takes a little more processing time AND you lose stereo, but at least you can freely position you mp3’s
A great feature for v3.5 to solve this would be that you could specify wether FORCEMONO uses the LEFT, the RIGHT or both channels.
This way you could play your stream twice, and position one rear-left and the other rear-right.
Currently you’ll have to use MONO though…
Oh, forgot to mention it…
When I first heard you could not play stereo streams in 3D, I also tried to use FSOUND_MONO, but this flag is only valid for creating new samples/streams I think.
That’s why brett added FSOUND_FORCEMONO, which converts existing streams to MONO.
If you are happy with Mono, there is no problem at all.
Just open your MP3 as a stream with flags FSOUND_HW3D and FSOUND_FORCEMONO and then play it in 3D.
You can set the position to (1,0,0) for front and (-1,0,0) for rear.
It might be that it is the last number for front/rear, you should just try…
Please login first to submit.