RecorderManager

Description

Get the globally unique recorder manager

Demo

Scan with the Smart Life app to try it out
Demo download URL →

FAQ

Q: How should I configure encodeBitRate?

A: The supported encodeBitRate ranges for different sample rates are:

Sample rateEncode bit rate range
8000Hz16000~48000 bps
11025Hz16000~48000 bps
12000Hz24000~64000 bps
16000Hz24000~96000 bps
22050Hz32000~128000 bps
24000Hz32000~128000 bps
32000Hz48000~192000 bps
44100Hz64000~320000 bps
48000Hz64000~320000 bps

Notes:

  1. Invalid combinations of sample rate and encode bit rate will cause recording to fail. Configure values strictly according to the table above
  2. Higher sample rates and encode bit rates are recommended for better audio quality
  3. Higher encode bit rates produce larger file sizes. Choose appropriate parameters according to your actual needs

Q: How should I configure the input source specified by audioSource?

A: audioSource is used to specify the input source for recording and supports the following values:

iOS platform:

  • auto: Automatically select the input source (default)
  • buildInMic: Built-in phone microphone
  • headsetMic: Wired headset microphone

Android platform:

  • auto: Automatically select the input source (default)
  • mic: Microphone (phone microphone or headset microphone)
  • camcorder: Suitable for audio/video recording
  • voice_communication: Suitable for real-time calls
  • voice_recognition: Suitable for speech recognition

Recommendations:

  1. It is recommended to use the default value auto, which adapts automatically to various scenarios
  2. Support for input sources may vary across devices and OS versions
  3. Thoroughly verify compatibility on target devices during development and testing