startSoundLevelMonitor method
- {ZegoSoundLevelConfig? config}
Starts sound level monitoring. Support enable some advanced feature.
Available since: 2.10.0
Description: After starting monitoring, you can receive local audio sound level via onCapturedSoundLevelUpdate callback, and receive remote audio sound level via onRemoteSoundLevelUpdate callback. Before entering the room, you can call startPreview
with this function and combine it with onCapturedSoundLevelUpdate callback to determine whether the audio device is working properly.
Use cases: During the publishing and playing process, determine who is talking on the wheat and do a UI presentation.
When to call: After the engine is created createEngine.
Caution:
- onCapturedSoundLevelUpdate and onRemoteSoundLevelUpdate callback notification period is the value set by the parameter.
- After the sound monitoring is started, even if the local audio capture is not started, onCapturedSoundLevelUpdate will have a callback, and the sound level is 0.
config
Configuration for starts the sound level monitor.
Implementation
Future<void> startSoundLevelMonitor({ZegoSoundLevelConfig? config}) async {
return await ZegoExpressImpl.instance
.startSoundLevelMonitor(config: config);
}