speak method
Implementation
@override
Future<void> speak(String text, VoiceConfig config) async {
await stop(); // Stop any current speech.
if (Platform.isMacOS) {
_speakProcess = await Process.start('say', [
'-r',
'${(175 * config.speed).round()}',
text,
]);
await _speakProcess!.exitCode;
_speakProcess = null;
} else if (Platform.isLinux) {
_speakProcess = await Process.start('espeak', [
'-s',
'${(175 * config.speed).round()}',
text,
]);
await _speakProcess!.exitCode;
_speakProcess = null;
}
}