音频播放,解决可暂停功能。参考资料

http://www.cnblogs.com/kenshincui/p/4186022.html#avPlayer



系统自带

#import <AVFoundation/AVFoundation.h>


1. AVAudioPlayer *player;


2.  player = [[AVAudioPlayer alloc]initWithContentsOfURL:_messageFrame.message.voicePath error:nil];

    player.delegate = self;


3.  [player prepareToPlay]; //准备播放

    [player play];//播放

    [player stop];//停止播放



4. - (void)audioPlayerDidFinishPlaying:(AVAudioPlayer*)player successfully:(BOOL)flag{

    

    NSLog(@"test////");

}




你可能感兴趣的:(ios,音频,播放)