Capture audio

 1AudioCapture.prototype.captureAudio = function(callback)
 2{
 3  var onCaptureSuccess = function(audio)
 4  {
 5    if (callback) callback(audio);
 6  }
 7  var onCaptureFail = function(message)
 8  {
 9    alert('Audio Capture Failed: ' + message);
10  }
11  navigator.device.capture.captureAudio(onCaptureSuccess, onCaptureFail,{});
12}

example file name and path after capture

file name: recording327205518.3gpp

path: file:///storage/sdcard0/recording327205518.3gpp

What’s next? We’re going to take a look at “Video audio playback”.

overlaied image when clicked on thumbnail

Makzan | Mobile web app dev with phonegap | Table of Content