diff options
| author | Grail Finder <wohilas@gmail.com> | 2026-01-13 12:00:32 +0300 |
|---|---|---|
| committer | Grail Finder <wohilas@gmail.com> | 2026-01-13 12:00:32 +0300 |
| commit | f57334b170715ea823ba2f3d0cc1c77791e11d28 (patch) | |
| tree | a7995bf580afc272c1f247ccb308f6eb8415b309 | |
| parent | 05a2098e02ad9e1b42c9f58be0a19627b55ee0b8 (diff) | |
Fix(tts): check if done channel is closed or not
| -rw-r--r-- | extra/tts.go | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/extra/tts.go b/extra/tts.go index 17a6dcb..fd4a235 100644 --- a/extra/tts.go +++ b/extra/tts.go @@ -110,7 +110,13 @@ func (o *KokoroOrator) stoproutine() { <-TTSTextChan } o.textBuffer.Reset() - o.currentDone <- true + if o.currentDone != nil { + select { + case o.currentDone <- true: + default: + // Channel might be closed, ignore + } + } o.interrupt = true } } @@ -317,7 +323,13 @@ func (o *GoogleTranslateOrator) stoproutine() { <-TTSTextChan } o.textBuffer.Reset() - o.currentDone <- true + if o.currentDone != nil { + select { + case o.currentDone <- true: + default: + // Channel might be closed, ignore + } + } o.interrupt = true } } |
