RecorderManager.start(params: Object)
Requires:
BaseKit≥2.3.2
Platforms:
iOSAndroid
Description
Start recording
Parameters
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
duration | number | No | 60000 | Recording duration in ms, max 600000 (10 minutes) |
sampleRate | 8000 | 11025 | 12000 | 16000 | 22050 | 24000 | 32000 | 44100 | 48000 | No | 8000 | Sample rate |
numberOfChannels | 1 | 2 | No | 2 | Number of channels |
encodeBitRate | number | No | 48000 | Encoding bitrate, in bps. Default: 48000 |
format | "mp3" | "aac" | "wav" | "PCM" | No | 'aac' | Audio format |
frameSize | number | Yes | - | Specify frame size in KB. When frameSize is set, after each chunk of the specified size is recorded, a callback returns the recorded file content; if not set, no callbacks are triggered. Currently supports mp3 and pcm only. |
audioSource | string | No | "auto" | Specify the audio input source for recording |
complete | () => void | No | - | Completion callback (executed on both success and failure) |
success | (params: Object) => void | No | - | Callback on successful API call |
fail | (params: Object) => void | No | - | Failure callback |
success callback parameters
| Property | Type | Description | Since |
|---|---|---|---|
tempFilePath | string | Temporary path of the recording file (local path) | v3.2.6 |
fail callback parameters
| Property | Type | Description |
|---|---|---|
errorMsg | string | Error message |
errorCode | string | number | Error code |
| Error extension |
Return Value
None
Valid Values
sampleRate
| Value | Description | Since |
|---|---|---|
8000 | - | - |
11025 | - | - |
12000 | - | - |
16000 | - | - |
22050 | - | - |
24000 | - | - |
32000 | - | - |
44100 | - | - |
48000 | - | - |
numberOfChannels
| Value | Description | Since |
|---|---|---|
1 | - | - |
2 | - | - |
format
| Value | Description | Since |
|---|---|---|
mp3 | - | - |
aac | - | - |
wav | - | - |
PCM | - | - |