fix(voice-call): Improve async handling and state management

Refactor voice call service to handle asynchronous operations more
precisely. Update method signatures to be async, use unawaited for
non-blocking calls, and ensure proper state reset between sessions.
Improve error handling and resource management for voice input and
text-to-speech services.
This commit is contained in:
cogwheel
2026-02-05 17:53:09 +05:30
parent c75898546a
commit dc2495dca0
5 changed files with 44 additions and 15 deletions

View File

@@ -149,6 +149,9 @@ class TextToSpeechService {
Future<void> dispose() async {
await _eventSubscription?.cancel();
_eventSubscription = null;
// Reset the singleton state for next session
await TtsManager.instance.reset();
}
/// Updates TTS settings.