Open gamebug001 opened 2 months ago
Play completed without calling
Play completed call
Version: 4.0.2 Flutter 3.22.2
Platform:
class:
class AiConsultationState { static final AiConsultationState _instance = AiConsultationState._internal(); AiConsultationState._internal(); factory AiConsultationState() { return _instance; } TextToSpeechPlayer ttsPlayer = TextToSpeechPlayer(); } import 'package:askaide/helper/logger.dart'; import 'package:flutter_tts/flutter_tts.dart'; class TextToSpeechPlayer { final FlutterTts _flutterTts = FlutterTts(); TextToSpeechPlayer() { _flutterTts.setLanguage("zh-CN"); // 根据语言设置 _flutterTts.setSpeechRate(1.0); // 设置语速 _flutterTts.setVolume(1.0); // 设置音量 _flutterTts.setPitch(1.0); // 设置音调 _flutterTts.awaitSpeakCompletion(true); _flutterTts.setQueueMode(1); _flutterTts.setCompletionHandler(() { Logger.debugLog("播放完成tts+++"); _onPlaybackComplete(); }); } speak(String result) { _flutterTts.speak(result); } }
speak Play completed setCompletionHandler No Execute
I'm also facing the same issue
🐛 Bug Report
Play completed without calling
Expected behavior
Play completed call
Reproduction steps
Configuration
Version: 4.0.2 Flutter 3.22.2
Platform:
class:
speak Play completed setCompletionHandler No Execute