Skip to content

fix: resolve voice download, preview cancellation, and local archive bugs (#45, #47, #56) - #73

Open
BlindMovies wants to merge 13 commits into
mush42:mainfrom
BlindMovies:main
Open

BlindMovies wants to merge 13 commits into
mush42:mainfrom
BlindMovies:main

Conversation

@BlindMovies

Copy link
Copy Markdown

Hello! This PR addresses several open issues regarding voice management and preview functionality.

Fixes included:

  • Fix Portuguese voices matching (Issue Brazilian and portuguese voices don't work #45): Updated VOICE_INFO_REGEX in voice_download.py to use \w instead of [a-z|_], which correctly allows voices with Unicode characters (like pt_PT-tugão-medium) to be recognized and downloaded.
  • Fix local voice installation (Issue Do not install voice from local file #47): Changed the .tar.gz extraction logic in install_voice_from_tar_archive. It now correctly extracts only the files to the root of the voice folder, discarding any absolute directory structure from the archive.
  • Fix un-cancellable voice preview (Issue The voice preview function cannot be stopped or backed out of #56): Added a dismiss_callback to AsyncSnakDialog for voice previews that safely triggers winsound.PlaySound(None, winsound.SND_PURGE). This allows users to properly cancel and exit the playback dialogue.

Note: My branch also includes the community patches for NVDA 2026.x / Python 3.13 compatibility to ensure it builds correctly in the latest NVDA versions.

Thank you for maintaining this amazing addon! Let me know if you need any adjustments.

austek and others added 13 commits April 26, 2026 19:52
…n, and implement build metadata testing suite
Bundled _miniaudio.pyd and _cffi_backend.cp311-win32.pyd were still
cp311-win32, causing "DLL load failed... not a valid Win32 application"
on NVDA 2026 (Python 3.13 64-bit). Replaces them with cp313-win_amd64
wheels from PyPI: miniaudio 1.71 and cffi 2.0.0.

Adds update_miniaudio.py and update_cffi.py mirroring update_grpc.py
so future refreshes are reproducible.

Bumps addon_version to 3.2-beta.1.
The previous '3.2-beta.1' value tripped test_version_parts_are_integers
because the middle part isn't pure digits. The beta signal is preserved
in the git tag (v3.2-beta.1) which drives the GitHub Release name.
The pinned v1.0.0 ref on huggingface.co/rhasspy/piper-voices/resolve/v1.0.0/voices.json
now returns a redirect to a 404 page (techexplorers123 hit JSONDecodeError when
mureq parsed the HTML body as JSON). raw/main is 200 with valid JSON.

Mirrors the same change the timonvanhasselt fork made:
- *_VOICE_LIST_URL now uses /raw/main (returns the file directly, no LFS)
- *_VOICE_DOWNLOAD_URL_PREFIX now uses /resolve/main (follows LFS pointers)
- get_rt_variant_download_url cleaned up to use f-string joining
URL pinning:
- voices.json reverted to raw/v1.0.0 — preserves reproducibility now that
  the diagnosis is clearer (mureq's default max_redirects=None couldn't
  follow HF's /resolve/ redirect; /raw/ returns the file directly so the
  pin works fine). piper-rt stays on main since that dataset has no tags.

SnakDialog has-been-deleted RuntimeError:
- AsyncSnakDialog schedules Hide/Close/Destroy then the done_callback via
  wx.CallAfter. The error-path gui.messageBox calls had no explicit parent,
  so NVDA inferred the dying SnakDialog as parent and raised when its
  underlying wx object was already destroyed.
- Pass parent=gui.mainFrame to messageBox calls in voice_manager's
  _voice_list_retrieved_callback and the symmetric done_callback paths in
  PiperVoiceDownloader / PiperRTVoiceDownloader.
- Fix tar archive extraction including absolute paths (Issue mush42#47)
- Fix VOICE_INFO_REGEX ignoring Portuguese voices like tugão (Issue mush42#45)
- Allow canceling voice preview playback (Issue mush42#56)
- fix: sort speaker names alphabetically (mush42#1)
- feat: LRU phrase cache for instant repeat phrases (mush42#2)
- feat: RMS audio normalizer post-processing (mush42#3)
- feat: night mode toggle script (soft/quiet audio) (mush42#4)
- feat: spatial stereo panning based on focus position (mush42#5)
- feat: per-app voice profile manager with auto-switch (mush42#6)
- feat: graceful multi-language fallback (keeps current voice) (mush42#7)
- feat: structural speaker alternation for brackets/quotes (mush42#8)
- feat: URL-based voice install wizard tab (mush42#9)
- i18n: Japanese translations for all new features
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants