AudioFileOpenURL ipod library

放肆的年华 提交于 2019-12-07 10:03:25

问题


I want to play music from iPod library using AudioFileOpenURL or ExtAudioFileOpenURL.

CFURLRef fileURL = [mediaItem valueForProperty:MPMediaItemPropertyAssetURL];
AudioFileOpenURL(fileURL,a,b,&id);
//or ExtAudioFileOpenURL

But it doesn't work! How can I deal with it?Thank you!


回答1:


This isn't going to work because MPMediaItem asset URLs are only valid within AV Foundation. You can use that asset URL to open an AVURLAsset, get an AVAssetReader, etc., but you can't open it using any CoreAudio interfaces.

Check out the AV Foundation programming guide for more info - in particular, you'll want to check out AVPlayer and friends:

http://developer.apple.com/library/ios/#documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/00_Introduction.html



来源:https://stackoverflow.com/questions/5487568/audiofileopenurl-ipod-library

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!