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
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 email@example.com or reply here.
- NiteBeast asked 17 years ago
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.
- Adion answered 17 years ago
Please login first to submit.