Commit adf14af8 authored by skeyboy's avatar skeyboy

tts语音适配iOS

parent 1610ec8c
......@@ -4,21 +4,15 @@ enum TtsState { playing, stopped, paused, continued }
class ChartTTS {
String voiceName;
String locale;
double volume;
double speechRate;
String language = "en-US";
String language = "zh-CN";
static ChartTTS tts = ChartTTS();
ChartTTS(
{this.voiceName = "Karen",
this.locale = 'en-AU',
this.volume = 1.0,
this.speechRate = 1.0}) {
ChartTTS({this.voiceName = "zh", this.volume = 1.0, this.speechRate = 1.0}) {
flutterTts.setLanguage(language);
flutterTts.setVolume(volume);
flutterTts.setSpeechRate(speechRate);
flutterTts.setVoice({"name": voiceName, "locale": locale});
}
final FlutterTts _flutterTts = FlutterTts();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment