选定的音乐未从 iPhone 音乐库中播放
我已经创建了一个 iPhone 应用程序。使用此应用程序,我可以录制我的声音并播放录制的文件。但如果我从库中选择一个音乐文件,它就不会播放。
// sample code that I have used in my application
self.player = [MPMusicPlayerController applicationMusicPlayer];
MPMediaPropertyPredicate *songNamePredicate = [MPMediaPropertyPredicate predicateWithValue: self.songName forProperty: MPMediaItemPropertyTitle];
MPMediaQuery *mySongQuery = [[MPMediaQuery alloc] init];
[mySongQuery addFilterPredicate: songNamePredicate];
[player setQueueWithQuery:mySongQuery];
[player play];
请帮我解决它。
I have created an iPhone application. Using this application, I can able to record my voice and able to play that recorded file. But if I select a music file from library, it is not playing.
// sample code that I have used in my application
self.player = [MPMusicPlayerController applicationMusicPlayer];
MPMediaPropertyPredicate *songNamePredicate = [MPMediaPropertyPredicate predicateWithValue: self.songName forProperty: MPMediaItemPropertyTitle];
MPMediaQuery *mySongQuery = [[MPMediaQuery alloc] init];
[mySongQuery addFilterPredicate: songNamePredicate];
[player setQueueWithQuery:mySongQuery];
[player play];
Please help me to resolve it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
改成
也
查询结果的值是多少
Change
to
also what is the value of the query result