0
与科尔多瓦一起使用录制应用程序并使用new Media
进行录制。我还使用了用于建立目录cordoba-file-plugin
等,所以,当应用程序初始化我跑科尔多瓦新媒体记录保存到目录
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fs){
app.root = fs;
}, function(error){
console.log(error);
});
然后我运行此代码:
app.root.root.getDirectory('appname', {create:true}, function(dirEntry){
dirEntry.getDirectory('recordings', {create:true}, function(subDirEntry) {
app.recordings = subDirEntry;
}, function(error){
console.log(error);
});
}, function(error){
console.log(error);
});
然后,我必须重新编码和脚本我想直接将文件保存到app.recordings
,这是我为此应用程序创建的目录。但没有出现。
var path = app.recordings.nativeURL;
var filename = path + "recording-" + new Date().getTime() + ".mp3";
var mediaRec = new Media(filename, app.services.audio.success, app.services.audio.error);
mediaRec.startRecord();
mediaRec.stopRecord();
我一直收到一个tmprecording-12351834581925.3gp的根目录。