Reputation: 1014
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.
Upvotes: 2
Views: 2322
Reputation: 5371
I recommend TSLibraryImport in iOS4+
http://code.google.com/p/tslibraryimport/
https://bitbucket.org/artgillespie/tslibraryimport
Upvotes: 3
Reputation: 1014
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.
Upvotes: 1
Reputation: 5098
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.
Upvotes: 0