我的应用程序将记录并存储一些声音,以便稍后播放它们。 现在,我可以录制保存在临时文件夹中的声音。
存储声音以便以后播放的最佳方式在哪里? 我需要数据库还是只将文件存储为文件?
My application will record and store some sounds to play them back later. Right now, I can record the sound which is saved in temporary folder.
Where is the best way to store sounds to play back later? Do I need database or just store as files?
最满意答案
文件目录中的文件。 或者可能是文档中的子目录。 使用子目录具有的优点是,您可能希望将其他数据文件存储在Docs dir的某个位置,但将所有录音保存在其自己的位置可以让您遍历文件或删除整个目录及其内容。 我已经看到很多消息表明它在SQLite中存储一堆二进制对象的效率和/或速度都很低。
Files in your Documents directory. Or perhaps a subdirectory within Docs. Using a subdirectory has the advantage that you may want to store other data files somewhere in Docs dir, but keeping all the sound recordings in their own location lets you iterate through the files or delete the entire directory and its contents. I've seen plenty of messages suggesting it's less efficient and/or fast to store a bunch of binary objects in SQLite.
更多推荐
发布评论