This is a cordova plugin for audio recording. And the record will be compressed into MP3 format by LAME.
- iOS >= 6.0
- Android >= 4.0
AudioRecorder.MAX= 1AudioRecorder.NORMAL= 2AudioRecorder.LOW= 3
NOTE: The transformation of mp3 files by LAME may fail when using other samplingrates.
AudioRecorder.hasPermission(success, error);
-
success: hasPermission success callback.
hasPermission: has audio recorder permission. (boolean)
-
error:hasPermission error callback
AudioRecorder.requestPermission(success, error);
AudioRecorder.startRecord(options, success, error); // auto request permission
-
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)duration: Set the duration of recorder file in seconds. default: 0(number)
-
success: startRecord 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: startRecord error callback.
errorMessage: a string about error(string)
AudioRecorder.stopRecord(success)
- success: stopRecord success callback.
AudioRecorder.playSound(path, success, error)
-
path: path for play local and remote file-base media.
-
success: play sound success callback.(keep callback)
status: play status(start、finish、stop). (string)
-
error: startRecord error callback.
errorMessage: a string about error(string)
AudioRecorder.playSound(success)
- success: stop sound success callback.(keep callback)
- Set duration for audio recording.
Save record in device storage.Play audio on device or Internet.