CaptureAudioOptions

Encapsulates audio capture configuration options.

Properties

  • limit: The maximum number of audio clips the device user can record in a single capture operation. The value must be greater than or equal to 1 (defaults to 1).
  • duration: The maximum duration of an audio sound clip, in seconds.
  • mode: The selected audio mode. The value must match one of the elements in capture.supportedAudioModes.

Quick Example

// limit capture operation to 3 media files, no longer than 10 seconds each
var options = { limit: 3, duration: 10 };

navigator.device.capture.captureAudio(captureSuccess, captureError, options);

Android Quirks

  • The duration parameter is not supported. Recording lengths cannot be limited programmatically.
  • The mode parameter is not supported. The audio recording format cannot be altered programmatically. Recordings are encoded using Adaptive Multi-Rate (AMR) format (audio/amr).

BlackBerry WebWorks Quirks

  • The duration parameter is not supported. Recording lengths cannot be limited programmatically.
  • The mode parameter is not supported. The audio recording format cannot be altered programmatically. Recordings are encoded using Adaptive Multi-Rate (AMR) format (audio/amr).

iOS Quirks

  • The limit parameter is not supported. One recording can be created for each invocation.
  • The mode parameter is not supported. The audio recording format cannot be altered programmatically. Recordings are encoded using Waveform Audio (WAV) format (audio/wav).