iosobjective-csoundcloud

iOS / Soundcloud API - Downloading track from Soundcloud API without stream_url request


Part of my iOS app is playing songs downloaded from Soundcloud with the help of their API. However, the songs are fully downloaded then played, not streamed. When the GET request is sent using the stream_url, the request takes extremely long to load into an AVAudioPlayer (I guess because of the 128kb/s cap on a track that is over an hour long), and the request using download_url does not work, most likely because downloading on the track is setup to only be accessible through a Facebook Band page.

I was curious if there is a faster way to download a track with these two options eliminated. Otherwise, is there a way to start streaming the song while the rest of the song loads into the player. For example, can I load the first 5 minutes of a track into a temporary player and then when the other player fully loads, have it take over the playing? The Soundcloud tracks being accessed are all from a friend, so I can ask him to change account options if necessary.


Solution

  • you need to use streaming technique instead of AVAudioPlayer . You can use AudioStreamer to allow playing audio while the loading. this solve my problem