audio
play URL audio using AVAudioPlayer
AVAudioPlayer is used to play audio file in iPhone. However, according to the document, it only support playing local audio file:
http://developer.apple.com/iphone/library/qa/qa2009/qa1634.html
To solve this problem, we can create a NSData using the NSURL and play the data using AVAudioPlayer
NSData *soundData = [NSData dataWithContentsOfURL:url];
AVAudioPlayer *avPlayer = [[AVAudioPlayer alloc] initWithData:soundData error: nil];
[avPlayer play];
Submitted by water on Thu, 2010-01-14 15:19

Recent comments
18 weeks 4 days ago
23 weeks 6 days ago
27 weeks 2 days ago
28 weeks 1 day ago
37 weeks 10 hours ago
37 weeks 10 hours ago
37 weeks 1 day ago
37 weeks 2 days ago
39 weeks 20 hours ago
39 weeks 2 days ago