changeVoice method

  1. @override
Future<int> changeVoice(
  1. String name
)
override

Selects a named ex2 voice; 0 means success and -1 means unavailable/fallback.

Implementation

@override
Future<int> changeVoice(String name) async {
  try {
    final result =
        await methodChannel.invokeMethod<int>('changeVoice', {'name': name});
    return result == 0 ? 0 : -1;
  } on MissingPluginException {
    return -1;
  } on PlatformException {
    return -1;
  }
}