AVPlayer可以在iPad上播放MP3文件
答
难道ü尝试使用
[[AVAudioPlayer alloc]initWithContentsOfURL:fileUrl error:nil];
播放文件
答
下面是一个完整的示例部分。
myClass.h:
- @interface myClass : NSObject \<AVAudioPlayerDelegate\> ...
myClass.m:
localPlayer = [[AVAudioPlayer alloc]
initWithContentsOfURL:newAudioURL error:nil]; [localPlayer
setDelegate:self];
- (void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)playedPlayer successfully:(BOOL)flag {
NSLog(@"releasing");
[playedPlayer release];
NSLog(@"released"); }