Welcome! Log In Create A New Profile

Advanced

MP3 player callback

Posted by arasium 
MP3 player callback
November 29, 2010 05:22PM
I'm trying to code an MP3/OGG player wich will support tracklists.

The problem, is that the MP3Player in the libogc doesn't have a callback called when the song is ended (use to play the next song). I still haven't read the OGG code.

Do you know if someone has already coded something like that?
Re: MP3 player callback
November 29, 2010 06:32PM
Why do you need a callback?

if(!MP3Player_IsPlaying())
{
  printf("MP3 has stopped!\n");
}
Re: MP3 player callback
November 29, 2010 06:56PM
Because i wan't to create a audio player that support tracklists. I know that i can pull the player to in order to know if the song has terminated, but this is an horrible way to do ( because this means that i need to create another thread than the one the player use)....

The better solution is that the player throw an event or call a callback when the song is terminated. That way, i just need to put the next song in the callback (and i need to put some thread safe stuff)

Generally players work like this... Real time coding is not the better option (it's just my opinion).
Sorry, only registered users may post in this forum.

Click here to login