File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package Messages
33import (
44 "strings"
55 "whispering-tiger-ui/Fields"
6+ "whispering-tiger-ui/Settings"
67)
78
89// TTS Languages
@@ -43,5 +44,18 @@ var TtsVoices TtsVoicesListing
4344func (res TtsVoicesListing ) Update () * TtsVoicesListing {
4445 Fields .Field .TtsVoiceCombo .Options = nil
4546 Fields .Field .TtsVoiceCombo .Options = append (Fields .Field .TtsVoiceCombo .Options , res .Voices ... )
47+
48+ // set first voice if selection is not in list
49+ voicesListContainsSelectedVoice := false
50+ for _ , voice := range res .Voices {
51+ if voice == Settings .Config .Tts_voice {
52+ voicesListContainsSelectedVoice = true
53+ break
54+ }
55+ }
56+ if ! voicesListContainsSelectedVoice {
57+ Fields .Field .TtsVoiceCombo .SetSelectedIndex (0 )
58+ }
59+
4660 return & res
4761}
You can’t perform that action at this time.
0 commit comments