0
0

Hi,

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):
[code:10fodif3]
streamHandle = FSound.FSOUND_Stream_Open(mediaString, 0, 0, FSound.FSOUND_NONBLOCKING | FSound.FSOUND_MPEGACCURATE);
FSound.FSOUND_Stream_SetMode(streamHandle,FSound.FSOUND_LOOP_OFF);

[/code:10fodif3]

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,
Jens

  • You must to post comments
0
0

i don’t think so i can play a 3 hour mp2 file with no special code, it may be different with mp3s but i don’t think so (i’m not using non_blocknig though so this may be the porblem?)

  • You must to post comments
0
0

Well,

Well the nonblocking mode offers me some more flex when doing DSP, this is important for me too. Annyone else can provide a tip ?

thx.,
– jens

  • You must to post comments
0
0

are you waiting for the file to finish loading before starting to play it?

  • You must to post comments
0
0

I would be pleased if you explain how this must be done :)

  • jens
  • You must to post comments
0
0

i don’t know ive never used it but according to the doumentation you have to use FSOUND_Stream_GetOpenState

  • You must to post comments
0
0

Jens,

Here is the VB method:

[code:3q39ov7b]
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
DoEvents
Loop

If FSOUND_Stream_GetOpenState(hStream) <> 0 Then [STREAM FAILURE: DO SOME ERROR HANDLING]
[/code:3q39ov7b]

Regards,

-SD

  • You must to post comments
0
0

Thx for your example VB Code …
Do you permantly monitor the return state of
FSOUND_Stream_GetOpenState ? If so, i have to use a Thread to monitor the value,right ?

  • Jens
  • You must to post comments
0
0

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.

Regards,

-SD

  • You must to post comments
Showing 8 results
Your Answer

Please first to submit.