Reply to comment
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
17 weeks 6 days ago
23 weeks 1 day ago
26 weeks 3 days ago
27 weeks 3 days ago
36 weeks 2 days ago
36 weeks 2 days ago
36 weeks 3 days ago
36 weeks 4 days ago
38 weeks 2 days ago
38 weeks 3 days ago