enableSilenceDetection method
Future<void>
enableSilenceDetection({
- required AudioDeviceFlow flow,
- required double threshold,
- required Duration duration,
override
Enables native silence detection for the given flow.
The threshold must be between 0.0 and 1.0.
The duration defines how long the peak level must remain below the
threshold before the flow is considered silent.
Implementation
@override
Future<void> enableSilenceDetection({
required AudioDeviceFlow flow,
required double threshold,
required Duration duration,
}) {
return methodChannel.invokeMethod<void>(
'enableSilenceDetection',
<String, Object?>{
'flow': flow == AudioDeviceFlow.input ? 'input' : 'output',
'threshold': threshold,
'durationMs': duration.inMilliseconds,
},
);
}