iPhone audio streaming - saving state?
-
23-08-2019 - |
Question
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.
Solution
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.
OTHER TIPS
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.