Skip to content

Commit

Permalink
* NVDA 2024.1 compatibility
Browse files Browse the repository at this point in the history
* Changed the name to Sonata because we're planning to support additional TTS models besides Piper
* Support for using fast variants of the voices. These variants are more responsive since they use streaming synthesis
* Speedups across the board
* Use a single, statically linked, executable for the TTS server
* Updated libtashkeel to latest version
  • Loading branch information
mush42 committed Apr 18, 2024
1 parent bf27545 commit 9465fce
Show file tree
Hide file tree
Showing 302 changed files with 23,701 additions and 79,531 deletions.
29 changes: 29 additions & 0 deletions 3.0-beta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"addonId": "sonata_neural_voices",
"displayName": "Sonata Neural Voices",
"URL": "",
"description": "Neural voices for NVDA based on Sonata",
"sha256": "63e667de02ed7ee4aa63354e66b5b781a1c601de2a62594c9589d4cd5af4a4c6",
"homepage": null,
"addonVersionName": "3.0-beta",
"addonVersionNumber": {
"major": 0,
"minor": 0,
"patch": 0
},
"minNVDAVersion": {
"major": 0,
"minor": 0,
"patch": 0
},
"lastTestedVersion": {
"major": 0,
"minor": 0,
"patch": 0
},
"channel": "beta",
"publisher": "",
"sourceURL": "https://github.com/mush42/sonata-for-nvda",
"license": "GPL 2",
"licenseURL": null
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@
_ADDON_ROOT = os.path.abspath(os.path.join(_DIR, os.pardir, os.pardir))
_TTS_MODULE_DIR = os.path.join(_ADDON_ROOT, "synthDrivers")
sys.path.insert(0, _TTS_MODULE_DIR)
from piper_neural_voices import helpers
from piper_neural_voices import aio
from piper_neural_voices.tts_system import (
PiperTextToSpeechSystem,
PIPER_VOICES_DIR,
from sonata_neural_voices import helpers
from sonata_neural_voices import aio
from sonata_neural_voices.tts_system import (
SonataTextToSpeechSystem,
SONATA_VOICES_DIR,
)
sys.path.remove(_TTS_MODULE_DIR)
del _DIR, _ADDON_ROOT, _TTS_MODULE_DIR

from .voice_manager import PiperVoiceManagerDialog
from .voice_manager import SonataVoiceManagerDialog


class GlobalPlugin(globalPluginHandler.GlobalPlugin):
Expand All @@ -44,30 +44,30 @@ def __init__(self, *args, **kwargs):
4,
wx.ID_ANY,
# Translators: label of a menu item
_("Piper voice &manager..."),
# Translators: Piper's voice manager menu item help
_("Open the voice manager to preview, install or download piper voices"),
_("Sonata &voice manager..."),
# Translators: Sonata's voice manager menu item help
_("Open the voice manager to preview, install or download sonata voices"),
)
gui.mainFrame.sysTrayIcon.menu.Bind(wx.EVT_MENU, self.on_manager, self.itemHandle)

def on_manager(self, event):
manager_dialog = PiperVoiceManagerDialog()
manager_dialog = SonataVoiceManagerDialog()
gui.runScriptModalDialog(manager_dialog)
self.__voice_manager_shown = True

def _perform_voice_check(self):
if self.__voice_manager_shown:
return
if not any(PiperTextToSpeechSystem.load_piper_voices_from_nvda_config_dir()):
if not any(SonataTextToSpeechSystem.load_piper_voices_from_nvda_config_dir()):
retval = gui.messageBox(
# Translators: message telling the user that no voice is installed
_(
"No Piper voice was found.\n"
"No Sonata voice was found.\n"
"You can preview and download voices from the voice manager.\n"
"Do you want to open the voice manager now?"
),
# Translators: title of a message telling the user that no Piper voice was found
_("Piper Neural Voices"),
# Translators: title of a message telling the user that no Sonata voice was found
_("Sonata Neural Voices"),
wx.YES_NO | wx.ICON_WARNING,
)
if retval == wx.YES:
Expand Down
Loading

0 comments on commit 9465fce

Please sign in to comment.