startRecord abstract method
Start record audio file.
Available since: 1.0.0
Description: Start recording audio files. The SDK will apply to the system to use the microphone device to collect audio and write it to a local file.
Use case: Before the user need to send voice messages, they can call this API to collect and generate the voice files required for sending. The recording files will eventually be saved to the path set locally.
When to call: After init.
Related APIs: When this API is called to start recording, the SDK will throw the onRecorderStarted
notification. Only after receiving this callback notification can the developer consider that recording has officially started and updated the UI display; after that, the SDK will call back the recording progress through onRecorderProgress
; under abnormal circumstances, the SDK may also throw an onRecorderFailed
notification, please Developers may monitor and alert users when exceptions occur as appropriate.
Caution: Developers are requested to ensure that they have obtained the audio collection permission of the app before using this API; when the SDK starts recording, it will exclusively have the right to use the audio device, so it will interrupt the playback and other behaviors of other third-party apps.
Restrictions: Recording-related APIs cannot be used at the same time as playback-related APIs. At the same time, only recording or playback can be performed inside the SDK. Therefore, before you need to start recording, developers are required to actively stop the playback function, otherwise the playback-related functions will also be stopped before the SDK starts recording.
config
Record config
Implementation
Future<void> startRecord(ZIMAudioRecordConfig config);