setNoiseSuppression method

Future<void> setNoiseSuppression(
  1. NoiseSuppressionLevelWithOff level
)

Sets the provided level value as a noise suppression to use.

Implementation

Future<void> setNoiseSuppression(NoiseSuppressionLevelWithOff level) async {
  switch (level) {
    case NoiseSuppressionLevelWithOff.off:
      await _call.value.applyVoiceProcessing(noiseSuppression: false);
      await _settingsRepo.setNoiseSuppression(false);
      break;

    case NoiseSuppressionLevelWithOff.low:
    case NoiseSuppressionLevelWithOff.moderate:
    case NoiseSuppressionLevelWithOff.high:
    case NoiseSuppressionLevelWithOff.veryHigh:
      await _call.value.applyVoiceProcessing(
        noiseSuppression: true,
        noiseSuppressionLevel: level.toLevel(),
      );

      await _settingsRepo.setNoiseSuppression(true);
      await _settingsRepo.setNoiseSuppressionLevel(level.toLevel());
      break;
  }
}