/Cordova_Plugin_AudioRecorder

This is a cordova plugin for audio recording. And the record will be compressed into MP3 format by LAME.

Primary LanguageCMIT LicenseMIT

Cordova_Plugin_AudioRecorder

This is a cordova plugin for audio recording. And the record will be compressed into MP3 format by LAME.

Supported Platforms

  • iOS >= 6.0
  • Android >= 4.0

Usage

Constants

  • AudioRecorder.MAX = 1
  • AudioRecorder.NORMAL = 2
  • AudioRecorder.LOW = 3

NOTE: The transformation of mp3 files by LAME may fail when using other samplingrates.

Start Record

AudioRecorder.startRecord(options, success, error);
  • options: recorder settings

    • outSamplingRate: Set sampling rate for output mp3. default: 22050(number)
    • outBitRate: Set bit rate for output mp3. default: 16(number)
    • isChatMode: If true then set AVAudioSessionModeVoiceChat in iOS and use NoiseSuppressor in Android. default: false(boolean)
    • isSave: If true then save mp3 file into device storage. default: false(boolean)
  • success: startRecord success callback.

  • error: startRecord error callback.

    • errorMessage: a string about error(string)

Stop Record

AudioRecorder.stopRecord(success, error)
  • success: stopRecord success callback.

    • file: output mp3 file object(This is a temporary file on device)
      • name: mp3 file's name.(string)
      • type: 'audio/mpeg'(string)
      • uri: file local uri(string)
  • error: stopRecord error callback

    • 'errorMessage': a string about error(string)

TODO LIST

  • Set duration for audio recording.
  • Save record in device storage.
  • Play audio on device or Internet

Reference

AndroidMp3Recorder

cordova-plugin-media