AudioFileOpenURL ipod library

2019-05-07 12:27发布

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!

标签: audio ipod
1条回答
叼着烟拽天下
2楼-- · 2019-05-07 12:47

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

查看更多
登录 后发表回答