AudioFileOpenURL Library

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

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

But that will not work! How can I handle this? Thanks!

+4
source share
1 answer

This will not work because the URLs of MPMediaItem assets are valid only in the AV Foundation. You can use the URL of this resource to open AVURLAsset, get AVAssetReader, etc., but you cannot open it using any CoreAudio interfaces.

Check out the AV Foundation Programming Guide for more information - 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

+4
source

Source: https://habr.com/ru/post/1345892/


All Articles