标签: ios objective-c avaudioplayer
当我的iOS应用程序启动时,我将如何播放声音;我应该使用AVPlayer播放mp3文件吗?
AVPlayer
答案 0 :(得分:0)
在didFinishLaunchingWithOptions:下方使用以下代码播放音频
didFinishLaunchingWithOptions:
NSURL *url = [NSURL URLWithString:pathToYourFile]; AVPlayer *audioPlayer = [[AVPlayer alloc] initWithURL:url]; [audioPlayer play];