iPhone SDK:如何将从 iPod 库中选取的音频文件写入应用程序的文档文件夹?
如何将从 mediaPicker
中选取的音频文件写入应用程序的文档文件夹?
基本上我是从 iPod 库中选择一个音频文件。
我希望将此选定的文件复制到我的应用程序的文档文件夹中。
这样我就可以从我的应用程序的文档文件夹中引用它。
可以做什么?
谢谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我建议在 iOS4+ 中使用 TSLibraryImport
http://code.google.com/p/tslibraryimport/
< a href="https://bitbucket.org/artgillespie/tslibraryimport" rel="nofollow">https://bitbucket.org/artgillespie/tslibraryimport
I recommend TSLibraryImport in iOS4+
http://code.google.com/p/tslibraryimport/
https://bitbucket.org/artgillespie/tslibraryimport
我找到了一种方法来转换 iPod 库歌曲并将其写入文档目录,使用
从 iPod 库到 PCM 样本所需的步骤比以前少得多
感谢 Mats Stijlaart 的帮助。但我得到了解决方案。
希望这对大家有帮助。
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.
我认为这是不允许的。这将使复制在 iTunes 中购买的文件变得更容易,所以我认为苹果不会允许这样做。
当您从音乐库中选取音乐时,您必须使用具有以下委托方法的 MPMediaPickerController:
MPMediaItemCollection 是某种列表。它的项目是 MPConcreteMediaItem 类的实例。 MPMusicPlayerController 可以播放 MPMediaItemCollection,但对于 MPConcreteMediaItems 却不能做任何事情。
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:
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.