i searching for some hint how to open a Mp3 with playbacktime greater than just some minutes. I tested Fmod and my Playback stops after 10-11 Minutes even if the whole playback should take about 60 minutes. The Files i tested are encoded at 192Kbit and CBR.
I open the Stream like this (it’s Java):
streamHandle = FSound.FSOUND_Stream_Open(mediaString, 0, 0, FSound.FSOUND_NONBLOCKING | FSound.FSOUND_MPEGACCURATE);
For me i looks like FMOD simply runs out of Data, may i have to poll FMOD so it will continue loading data ?
Thx 4 help,
Yes, that’s right: In this example, the open state is repeatedly polled until it does NOT equal -2 (-2 means ‘busy’ or ‘opening’). Then check that the value is zero. If zero, then the stream is ready (it’s open and has been fully scanned).
Using the NONBLOCKING option, you could also instruct your application to branch elsewhere, and do something else in the interim; but my example assumes that there isn’t much to do UNTIL the stream has been fully scanned.
In VB, ‘DoEvents’ is needed so that the application (and Windows) continues to run smoothly while the code is temporarily stuck in a monitoring loop.
Thus, use this type of approach if you need MPEGACCURATE scanning, and you need to ensure that the audio program is fully scanned (for reliable time/seek operations) before the application continues. If the latter is not important, then you can check the status of FSOUND_Stream_GetOpenState whenever you wish. When it’s zero, you know that FMod is finished opening/scanning the file.
Here is the VB method:
hStream = FSOUND_Stream_Open(FileName, FSOUND_MPEGACCURATE Or FSOUND_NONBLOCKING, 0&, 0&)
If hStream = 0 Then [STREAM FAILURE: DO SOME ERROR HANDLING]
Do While FSOUND_Stream_GetOpenState(hStream) = -2
If FSOUND_Stream_GetOpenState(hStream) <> 0 Then [STREAM FAILURE: DO SOME ERROR HANDLING]
Please login first to submit.