0

I'm using Matt Gallagher's AudioStreamer to stream MP3's from my server. The URL i'm providing is a direct link to the MP3, but i've also tried using PHP to serve the MP3 and provide the accurate header information.

The problem I have is that the duration that AudioStreamer object provides changes, it starts of low and during the progress of the stream, it increases. How can I get the duration to be the exact entire duration of the audio file?

Sometimes it works, but more often than not it changes. Thanks for your help.

Wasim
  • 4,953
  • 10
  • 52
  • 87
  • i have previously used this audiostreamer and switched back to avplayer . do you have a specific reason to use this library or you just found it out? – iremk Aug 15 '12 at 14:43
  • Well I just used it because I searched for an audio streaming solution. I checked out AVPlayer but couldn't figure out how to get the duration/progress from the AVPlayer object...do you know? – Wasim Aug 15 '12 at 20:44
  • 1
    yeah, you can initialize it with avplayeritem and this have a property which have duration . and you can create an avplayer with this avplayeritem and then just play.. :) you will have a great streaming code.. :) if you need the code i'll write as an answer – iremk Aug 16 '12 at 08:58
  • I've changed my app to use AVPlayer now, it's great, much more accurate duration now. Only issue is the status changes, there aren't as many as with AudioStreamer...did you face this problem? – Wasim Aug 16 '12 at 21:16
  • what you mean by status changes? play/pause/stop like statuses? – iremk Aug 17 '12 at 06:39
  • Yea thats what I mean, but I seem to have figured it out sort of by using `[self.audio addObserver:self forKeyPath:@"rate" options:0 context:nil];` but would be nice to have a notification for a loading status – Wasim Aug 17 '12 at 09:43
  • there you could use another observer i guess which is triggered when the player is ready to play , you could think that as a loading status :) – iremk Aug 17 '12 at 13:17

0 Answers0