我做了很多寻找,看起来代码是正确的。我不知道从哪里开始。它只是没有记录任何东西
if(device.platform == "iPhone")
{
myFileRecord = "myrecording.wav";myMime="audio/x-wav";
document.addEventListener("deviceready", function onDeviceReady() {
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS1, function fail1(){});
}, false);
var gotFS1 = function (fileSystem) {
fileSystem.root.getFile("myrecording.wav",
{ create: true, exclusive: false }, //create if it does not exist
function success(entry) {
var src = entry.toURI();
console.log(src); //logs blank.wav's path starting with file://
},
function fail1() {}
);
};
}
recordAudio();
}
答案 0 :(得分:1)
您不能使用'=='来检查字符串。
尝试:
if ([device.platform isEqualToString:@"iPhone"])
此外,您可能需要查看http://theiphonewiki.com/wiki/Models并查看“标识符”列。这些很可能是'device.platform'将被设置为。