Fixed 2 speech-dispatcher bugs. First, multiword voice names were not available. Next, when the module changed the old voice name was carried in causing some modules to fail. Ported over fixes from Fenrir. This mostly affected the quick speech keys.
This commit is contained in:
@@ -36,6 +36,7 @@ from . import cmdnames
|
||||
from . import cthulhu
|
||||
from . import dbus_service
|
||||
from . import debug
|
||||
from . import guilabels
|
||||
from . import input_event
|
||||
from . import keybindings
|
||||
from . import messages
|
||||
@@ -479,6 +480,20 @@ class SpeechAndVerbosityManager:
|
||||
if not filtered:
|
||||
return []
|
||||
|
||||
if hasattr(server, "getOutputModule"):
|
||||
try:
|
||||
module = server.getOutputModule() or ""
|
||||
except Exception:
|
||||
module = ""
|
||||
if module:
|
||||
default_name = guilabels.SPEECH_DEFAULT_VOICE % module
|
||||
real_voices = [
|
||||
voice for voice in filtered
|
||||
if voice.get(speechserver.VoiceFamily.NAME) != default_name
|
||||
]
|
||||
if real_voices:
|
||||
filtered = real_voices
|
||||
|
||||
if not self._should_filter_voices_by_locale(server):
|
||||
return filtered
|
||||
|
||||
|
||||
@@ -823,6 +823,8 @@ class SpeechServer(speechserver.SpeechServer):
|
||||
|
||||
def setOutputModule(self, module):
|
||||
self._client.set_output_module(module)
|
||||
self._default_voice_name = guilabels.SPEECH_DEFAULT_VOICE % module
|
||||
self._current_voice_properties.pop(ACSS.FAMILY, None)
|
||||
|
||||
def stop(self):
|
||||
self._cancel()
|
||||
|
||||
Reference in New Issue
Block a user