feat(tts): Refactor text splitting and offset computation for TTS

This commit is contained in:
cogwheel0
2025-11-05 00:59:57 +05:30
parent 3424af60f9
commit 0d49309ad1
2 changed files with 25 additions and 25 deletions

View File

@@ -657,6 +657,12 @@ class TextToSpeechService {
);
}
/// Splits [text] into the chunks used for playback sequencing.
///
/// This mirrors the server-side streaming behavior so UI consumers can stay
/// in sync with sentence indices reported during playback.
List<String> splitTextForSpeech(String text) => _splitForTts(text);
Future<void> _onAudioComplete() async {
final session = _session;
// If there are more expected chunks