Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
captureAudio: function (successCallback, errorCallback, args) {
var options = args[0];
var audioOptions = new CaptureAudioOptions();
if (typeof (options.duration) === 'undefined') {
audioOptions.duration = 3600; // Arbitrary amount, need to change later
} else if (options.duration > 0) {
audioOptions.duration = options.duration;
} else {
errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT));
return;
}
// Some shortcuts for long namespaces
var CaptureNS = Windows.Media.Capture;
var MediaPropsNS = Windows.Media.MediaProperties;
var localAppData = Windows.Storage.ApplicationData.current.localFolder;
var generateUniqueName = Windows.Storage.NameCollisionOption.generateUniqueName;
var mediaCapture = new CaptureNS.MediaCapture();