How to create audio stream pre buffer like sveriges radio iPhone app?
I've download this app and i search since long time how to create the pre buffer.
For example: I click on play My app load the stream in the buffer After 10 seconds (my buffer get 10 seconds in advance) I start the stream for the first 10 secs (i've got 10 secs i开发者_JAVA技巧f my reachability failed or something else) When my phone is unreachable (my stream continue for 10 sec and the buffer is empty) if the reachability is back (rebuffed & play)
http://itunes.apple.com/us/app/sveriges-radio-play/id300548244?mt=8
This is a really broad question. You're going to have to play with NSURLRequest to get your raw data of X seconds into a local byte buffer. The 10 seconds you will have to calculate based on the type of data coming in (i.e. mp3 @ 8Khz etc). Once you do that, you can start throwing your data into an AudioQueue (which has its own buffers).
精彩评论