tags:

views:

418

answers:

1

I am trying to find the best way to play a URL of an mp3. I've tried Audiostreamer but it doesn't fit my needs as it's geared towards infinite streams, and not finite streams.

Any help is appreciated!

Thanks!

+1  A: 

AVAudioPlayer is your answer:

http://developer.apple.com/iPhone/library/documentation/AVFoundation/Reference/AVAudioPlayerClassReference/Reference/Reference.html#//apple_ref/occ/instm/AVAudioPlayer/initWithContentsOfURL:error:

Dan Lorenc
What if the URL needs to have a cookie passed to it?
WedTM
Then you can use the [AVAudioPlayer initWithData] method. Use an NSURLRequest to generate the proper request with the cookie, then save the response as an NSData object.
Dan Lorenc
Awesome, thanks!
WedTM