0
0

I tried to get time of mp3 stream in vc++ and CDX game engine.I put the code inside the game loop but it’s always return 0 even I copied codes from fmod example.It’s still return the same result.

  • You must to post comments
0
0

I ‘ve checked already and I didn’t put any of FSOUND_NONBLOCKING.
Here is my code for showing the time of mp3 file while it’s playing.Can you correct it ,please? Thxs A lot :)

//—————
char s[50];
stream= FSOUND_Stream_Open”theway_bg.mp3″,FSOUND_16BITS,0,0);

FSOUND_Stream_Play(0,stream);
sprintf(s,”Time %02d:%02d/%02d:%02d”, FSOUND_Stream_GetTime(stream[1]) / 1000 / 60,
FSOUND_Stream_GetTime(stream) / 1000 % 60,
FSOUND_Stream_GetLengthMs(stream) / 1000 / 60,
FSOUND_Stream_GetLengthMs(stream/ 1000 % 60);
Screen->GetBack()->TextXY(380,200,RGB(255,255,255),s); // Show time on screen

  • You must to post comments
0
0

One more question. How can I know that my stream handle is null?

  • You must to post comments
0
0

Noooo…It’s not my typo. I copied it from your fmod example.
And I checked the stream handle by using FSOUND_Stream_GetOpenState, it returned -1.
What is it means? How should I fix this problem.
Thanks again. :)

  • You must to post comments
0
0

I tried FSOUND_Stream_GetTime(stream).It returned 0 again… 😥

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.