Cthulhu is no longer a fork. Now it is a screen reader written in Golang.
This commit is contained in:
1 parent
a998fe67de
commit
069fc674dc
708 files changed
+112482
-532
No files matched your search
@@ -0,0 +1,32 @@
|
||||
// Copyright (c) 2026 Storm Dragon
|
||||
// Authors: Storm Dragon, Angus Kola
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
package preferences
|
||||
|
||||
import (
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
"git.stormux.org/storm/cthulhu/internal/speech"
|
||||
)
|
||||
|
||||
// default_voices filters eSpeak's language/variant combinations for controls
|
||||
// without an explicit language selection. Saved voices remain available through
|
||||
// the caller's selected-family entry, and the full language catalog is retained.
|
||||
func (session *uiSession) default_voices(module string) []speech.Voice {
|
||||
voices := session.catalog[module]
|
||||
if strings.Contains(strings.ToLower(module), "espeak") {
|
||||
return speech.LocaleVoices(voices)
|
||||
}
|
||||
if module == "" {
|
||||
// Speech Dispatcher also lists the default synthesizer under an empty
|
||||
// module name. Match its catalog to identify eSpeak without guessing.
|
||||
for name, candidates := range session.catalog {
|
||||
if strings.Contains(strings.ToLower(name), "espeak") && slices.Equal(voices, candidates) {
|
||||
return speech.LocaleVoices(voices)
|
||||
}
|
||||
}
|
||||
}
|
||||
return voices
|
||||
}
|
||||
Reference in new issue
Block a user