0
可能重复:
How to play a song from the itunes library in iphone如何以编程方式启动和停止歌曲?
在我的应用程序,
我想从iPhone获取库的歌曲。
而且想播放那首歌。
我该如何取歌?
以及如何在我的应用中以编程方式启动和停止歌曲?
可能重复:
How to play a song from the itunes library in iphone如何以编程方式启动和停止歌曲?
在我的应用程序,
我想从iPhone获取库的歌曲。
而且想播放那首歌。
我该如何取歌?
以及如何在我的应用中以编程方式启动和停止歌曲?
AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL URLWithString:recordFile] error:nil];
[player prepareToPlay];
[player play];
[player pause];
简易代码。 – Devang