2013-03-19 82 views
1

我已经做了很多寻找,并且它看起来像代码是正确的。我没有任何线索从哪里去。它只是不记录任何在iPhone上不记录音频

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(); 

}

回答

1

不能使用“==”来检查的字符串。

尝试:

if ([device.platform isEqualToString:@"iPhone"]) 

此外,你可能想看看http://theiphonewiki.com/wiki/Models,并期待在列 “标识符”。这些可能是'device.platform'将要设置的。