我看了很多,看起来代码是正确的。我不知道从这里去哪里。它只是不记录任何东西
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();
最佳答案
您不能使用“==”来检查字符串。
尝试:
if ([device.platform isEqualToString:@"iPhone"])
此外,您可能需要查看 http://theiphonewiki.com/wiki/Models并查看“标识符”列。这些可能是“device.platform”要设置的内容。
关于ios - 在 iPhone 上录制音频不保存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15506468/