0
0

Hello,

Been playing with FMOD for a little while now, and I’m really impressed. I have one request as I’m at a loss. I have written an MP3 player for myself using Delphi. I created a special procedure SetUpFMOD(Filename : String);

This is so I can extract ID3 Tag info, Frequency, bitrate, etc from the stream to populate the various LED’s I have on my form. I call this for ever song to be loaded.

I have decided not to use the array of TSongType and have opted for a StringList created dynamically. This better suits my needs, so I keep using the same variable TSong : TSongType; over and over again. Everything works fine in my code to go through a playlist by clicking next and previous. However, I can’t seem to be able to determine when a stream ends properly. When I do find the stream end and use a NextBtnClick(Nil) to force to the next song I go into a repeating loop of Next Button clicks. I use this call to find out when the stream ends:

If FSOUND_IsPlaying = False then
NextBtnClick(Nil);

My NextBtn event is a stopbtnclick, a load of next song, then a playbtnclick.

I’m really lost here, if anyone has an example of a playlist without using the FSONG array could you please e-mail it to me at nitebeast@shaw.ca or reply here.

Thanks.

  • You must to post comments
0
0

One more piece of info. I used the code from the Delphi FMOD example as reference, the major change is there is no reference to Modules for the songs.

  • You must to post comments
0
0

I think the problem is that there is some time between the play command and when the stream actually starts playing.
If you check between these 2 events if FSOUND_Isplaying, then this will still be false.
If you can use callbacks you can use the FSOUND_Stream_EndCallback to determine the end of a stream or you should add some variable that says the song is started, and you don’t do a nextsong until the song is started and it is not playing anymore.

  • You must to post comments
0
0

Problem Solved, thanks.

I decided to redo all the FMOD code and not use the TSongType record at all. Now everything works just wonderfully.

Thanks, you put me in the right direction.

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.