summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
Diffstat (limited to 'extra')
-rw-r--r--extra/tts.go16
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
}
}