简体   繁体   中英

iPhone SDK: How can I write an audio file picked from iPod Library into my app's Documents Folder?

How can I write an audio file picked from mediaPicker into my app's Documents Folder?

Basically I am selecting a audio file from iPod Library.

I want that this selected file be copied into my app's Documents folder.

So that I can reference it from my app's Documents folder.

What can be done?

Thanks.

I found a way to convert iPod libray song and write it to documents directory, using

From iPod Library to PCM Samples in Far Fewer Steps Than Were Previously Necessary

Thanks Mats Stijlaart for your help. But I got the solution for this.

Hope this helps everyone.

I do not think this is allowed. This will make it more easy to copy file bought in iTunes, so i do not think apple will allow that.

When you pick music from your music library, you will have to use a MPMediaPickerController with the following delegate method:

- (void) mediaPicker: (MPMediaPickerController *) mediaPicker didPickMediaItems: (MPMediaItemCollection *) mediaItemCollection

MPMediaItemCollection is some kind of list. It's items are instances of the MPConcreteMediaItem class. The MPMusicPlayerController can play a MPMediaItemCollection, but with MPConcreteMediaItems but you can not do anything.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM