Merge branch 'tts-graceful-degrade' of https://github.com/eli-schwartz/calibre

This commit is contained in:
Kovid Goyal 2024-09-13 13:22:49 +05:30
commit 1808e6118d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -221,13 +221,17 @@ def available_engines() -> dict[str, EngineMetadata]:
'for natural sounding voices. The neural network is run locally on your computer, it is fairly resource intensive to run.' 'for natural sounding voices. The neural network is run locally on your computer, it is fairly resource intensive to run.'
), TrackingCapability.Sentence, can_change_pitch=False, voices_have_quality_metadata=True, has_managed_voices=True) ), TrackingCapability.Sentence, can_change_pitch=False, voices_have_quality_metadata=True, has_managed_voices=True)
if islinux: if islinux:
from speechd.paths import SPD_SPAWN_CMD try:
cmd = os.getenv("SPEECHD_CMD", SPD_SPAWN_CMD) from speechd.paths import SPD_SPAWN_CMD
if cmd and os.access(cmd, os.X_OK) and os.path.isfile(cmd): except ImportError:
ans['speechd'] = EngineMetadata('speechd', _('The Speech Dispatcher Engine'), _( pass
'The "speechd" engine can usually track the currently spoken word on screen, however, it depends on the' else:
' underlying output module. The default espeak output module does support it.' cmd = os.getenv("SPEECHD_CMD", SPD_SPAWN_CMD)
), TrackingCapability.WordByWord, allows_choosing_audio_device=False, has_multiple_output_modules=True) if cmd and os.access(cmd, os.X_OK) and os.path.isfile(cmd):
ans['speechd'] = EngineMetadata('speechd', _('The Speech Dispatcher Engine'), _(
'The "speechd" engine can usually track the currently spoken word on screen, however, it depends on the'
' underlying output module. The default espeak output module does support it.'
), TrackingCapability.WordByWord, allows_choosing_audio_device=False, has_multiple_output_modules=True)
return ans return ans