Hi
How can I save the current state of an audio file currently being streamed by my app. I want to start the song at the same place where the user left it (something like what Pandora does when listening to a song)
Right now I am getting the packet number being played. From the packet number I get the byte number and send it in the Range header field. But this does not work and returns the whole song right from the beginning.
I am using AudioFileStream and CFHTTPStream to stream the audio.
Thanks.
-
This really depends a lot on the capabilities of the streaming server. Most of the common streaming servers don't support range - like Shoutcast or Icecast.
lostInTransit : Thanks John. How does Pandora do it then? They must be using the range param too in order to start the song from where the user left it?John Fricker : Pandora's magic is in the server. I would guess they've built their own from the ground up.lostInTransit : I checked with my server. It supports the Range header. So that is not an issue. Now how do I do it? -
That's how we do it (although we use NSURLConnection). Sounds like your server isn't respecting the range header. Start debugging there -- the problem is either that your server doesn't support the range header or your client isn't sending it properly.
0 comments:
Post a Comment