2

I like the user to pick an audio file from the available list of audio and copy it into my own app. In the retrieved items of userMediaItemCollection in the Apple sample code "AddMusic" there is the property: MPMediaItemPropertyAssetURL. But I cant get to it, since I get the error "MPMediaItemPropertyAssetURL undeclared" - although I imported MPMediaItem.h.

In the apple doc it says:

MPMediaItemPropertyAssetURL

A URL pointing to the media item, from which an AVAsset object (or other URL-based AV Foundation object) can be created, with any options as desired. Value is an NSURL object.

The URL has the custom scheme of ipod-library. For example, a URL might look like this: ipod-library://item/item.m4a?id=12345

Usage of the URL outside of the AV Foundation framework is not supported.

Available in iPhone OS 4.0 and later.

Declared in MPMediaItem.h


Does that mean, it is not possible to access the audio files for own use?
Is there a workaround?

Many thanks

1
  • After having looked around everywhere, I didn't find anything. So the only other good way to have persistent access to a chosen song after the app has been closed is just to use the MPMediaItemPropertyPersistentID.
    – user387184
    Jul 13, 2010 at 9:27

3 Answers 3

1

I learned that there is NO way of doing this. As I wrote in the comment - just use MPMediaItemPropertyPersistentID.....

1

This is an old thread but you can copy a MPMediaItem. You need to use AVAssetExportSession though and not NSFileManager

0

You should be able to use AVURLAsset, and pass in that URL to the initializer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.