changeVoice method

Future<void> changeVoice(
  1. String voice
)

Implementation

Future<void> changeVoice(String voice) async {
  final normalized = voice.trim();
  if (_activeModality != 'audio' || !canChange || _voiceChangeHandler == null || normalized.isEmpty || normalized == _activeVoice) {
    return;
  }
  _changing = true;
  _notifyChanged();
  try {
    await _voiceChangeHandler!(normalized);
  } finally {
    _changing = false;
    _notifyChanged();
  }
}