0
0

Hey guys, been about 2 years since I last used FMOD. Using it again in a simple little program that allows me to explore the data files that come with NeverwinterNights.

The application is a normal single threaded windows application. Currently doesn’t use DirectX or OpenGL directly.

However, I am having 2 minor problems.

The first problem is that FMOD seems to be having problems with the very beginning of the Bioware MP3 files. These files seem to be standard MP3 files excluding an 8 byte header of “BMU V1.0” which I am removing from the memory stream. Even with the 8 byte header, MS Media Player has no problem playing the file using the standard MP3 codec.

When I use FMOD to play the file using memory streams, is seems the start is garbled. Maybe the first 200ms. The rest plays just fine.

My startup code is very simple. (error checking removed)

[code:104iljay]
FSOUND_Init (44100, 32, 0);
FSOUND_SetBufferSize (1000);//shot in the dark
[/code:104iljay]

The actual play code is as follows:

[code:104iljay]
m_pStream = FSOUND_Stream_OpenFile (pData,
FSOUND_NORMAL | FSOUND_LOADMEMORY, nSize);
FSOUND_Stream_SetEndCallback (m_pStream,
StreamCallback, (int) (LPARAM) this);
int nChannel = FSOUND_Stream_PlayEx (
FSOUND_FREE, m_pStream, NULL, FALSE);
[/code:104iljay]

This code works great for WAV files (in RIFF format)

I am supplying the whole MP3/WAV file to the FSOUND_Stream_OpenFile routine.

I have also tried 3.36 with the same results.

My other problem is that it seems that for some unknown reason, FMOD stops sending streams to the sound system. It goes through the motions of creating and playing the stream without error. However, no sound comes out. I even get the end callback at the expected time.

This problem usually happens when I click on a different window on my desktop. Many times, the sound will start playing again if I my window is no longer the active window. Once I click on my window from the application tray at the bottom, the sound stops again.

Excluding the FSOUND_Close, and an FSOUND_Stream_Stop (which doesn’t get called), I have no other FMOD calls in my code. Nor does my application eat up 100% of the CPU. It doesn’t have any funky window activation or focus code.

Any ideas? :)[/code]

  • You must to post comments
0
0

You do not specify FSOUND_INIT_GLOBALFOCUS in FSOUND_Init(), so sound will stop when your application window loses focus. For more information, look for FSOUND_Init in the FMOD help file.

  • You must to post comments
0
0

(slaps forehead)

😳

That one deserves and RTFM.

  • You must to post comments
0
0

Will try the HWND routine. For my application, it is probably best that the sound stop when they focus another application.

It was 3.6 that I tried. I downloaded it while I was looking to see if anybody else had a problem like mine. I guess I just got the number wrong. :)

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.