开发者

Can AVPlayer play MP3 files on iPad

Can AVPlayer place MP3 files?

It does not l开发者_StackOverflow社区ist MP3 in the apple documentation.


Did u try using

   [[AVAudioPlayer alloc]initWithContentsOfURL:fileUrl error:nil];

to play the file


Yes it can play MP3.

Try reading the apple documentation here and specifically the section entitled "iOS Hardware and Software Audio Codecs"

Can AVPlayer play MP3 files on iPad


Here is a complete sample.

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"); }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜