in src/windows/CaptureProxy.js [362:384]
function (err) {
// -1072868846 is the error code for "No suitable transform was found to encode or decode the content."
// so we try to use another (m4a) format
if (err.number === -1072868846) {
// first we clear existing timeout to prevent success callback to be called with invalid arguments
// second we start same actions to try to record m4a audio
clearTimeout(stopRecordTimeout);
localAppData.createFileAsync('captureAudio.m4a', generateUniqueName).then(function (storageFile) {
capturedFile = storageFile;
mediaCapture.startRecordToStorageFileAsync(m4aEncodingProfile, capturedFile).then(
function () {
stopRecordTimeout = setTimeout(stopRecord, audioOptions.duration * 1000);
},
function () {
// if we here, we're totally failed to record either mp3 or m4a
errorCallback(new CaptureError(CaptureError.CAPTURE_INTERNAL_ERR));
}
);
});
} else {
errorCallback(new CaptureError(CaptureError.CAPTURE_INTERNAL_ERR));
}
}