Using iPhone audio files in own app - copy the audio file - is that possible?

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

Answers


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


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


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


Need Your Help

Good framework for live charting in Python?

python live charts

I am working on a Python application that involves running regression analysis on live data, and charting both. That is, the application gets fed with live data, and the regression models re-calcul...

Creating JDBC Connection in SOAPUI

java mysql soap jdbc soapui

I am new to SOAPUI and have been trying to do query and procedure testing using SOAPUI.