I am streaming a MP3 over network using custom feeding code, not AVAudioPlayer
(which only works with URLs) using APIs like AudioFileStreamOpen
and etc.
Is there any way to estimate a length of the stream? I know that I can get a 'elapsed' property using:
if(AudioQueueGetCurrentTime(queue.audioQueue, NULL, &t, &b) < 0)
return 0;
return t.mSampleTime / dataFormat.mSampleRate;
But what about total duration to create a progress bar? Is that possible?
P.S. Clarification - I do know the actual size of the MP3 file, don't know if that can be used... I'll even settle for solution that just gives me a progress bar, not the actual time of play/duration.