, , . Cordova Media API, iOS , , WAV . , ( , , ), script , , :
var audioRecSrc = "myrecording.wav";
var audioPlaySrc = "audiotoplay.mp3"
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail);
}
function gotFS(fileSystem) {
fileSystem.root.getFile(audioRecSrc, {create: true, exclusive: false}, gotFileEntry, fail);
}
function gotFileEntry(fileEntry) {
var audioRec = new Media(audioRecSrc, onSuccess, onError);
audioRec.startRecord();
var audioPlay = new Media(audioPlaySrc, onSuccess, onError);
audioPlay.play();
}
function fail(error) {
console.log("error : " + error.code);
}
API Cordova, . , API (, , )
iOS. Mobile Safari (PhoneGap UIWebView iPhone SDK):
-
, iOS, . , - iOS. . . . " " (. 41)
, , , . StarComposer, iPhone , PhoneGap. PhoneGap Cordova, JavaScript, . , , HTML5 iOS. , , 23:
https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Using_HTML5_Audio_Video.pdf