Hi to all,
I neet to get the time of the song when it is playing. I am using the code below:
static enum mad_flow header(void *data, struct mad_header const *header) { mad_timer_add(&musicTimer, header->duration); return MAD_FLOW_CONTINUE; }
long mp3_song_time(void) { return mad_timer_count(musicTimer, MAD_UNITS_MILLISECONDS); }
The code works, but it is not fast enough. I am getting the time with " mp3_song_time" faster than the header is called. (obs: I am using two processors, one to decode the song and the other to run the code that uses the song time).
Is there another way to get the right (more accurate) time?
Thanks in advance,