Fix Piper TTS voices stuck on "Loading voices..."#18
Merged
Conversation
…ge TTS Co-authored-by: k1rk11 <69209514+k1rk11@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Replace edge_tts with offline open source neural alternative
Add Piper TTS as an optional offline neural TTS provider
Mar 18, 2026
Co-authored-by: k1rk11 <69209514+k1rk11@users.noreply.github.com>
Copilot stopped work on behalf of
crisbbc due to an error
March 18, 2026 15:34
Copilot
AI
changed the title
Add Piper TTS as an optional offline neural TTS provider
Fix Piper TTS voices stuck on "Loading voices..."
Mar 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Switching to Piper TTS left the Voice tab permanently showing "Loading voices…" — voices never populated and the dropdown remained unusable.
Two independent bugs caused this:
parent_windownever wired up (settings_window.py) —VoiceTabwas constructed withoutparent_window, so_load_voices()fetched voices in the background thread but theif self.parent_window:guard silently dropped theafter()callback, meaning_apply_voices_ui()never ran.Provider-unaware voice cache (
tts_engine.py) —get_available_voices()used a purely time-based cache. After switching providers the still-fresh cache returned the previous provider's voices; the Voice tab would silently display stale Edge TTS voices while Piper was active (or vice versa).Changes
src/gui/settings_window.py— passparent_window=self.windowwhen constructingVoiceTab.src/tts/tts_engine.py_cached_provider: strfield alongside the existing time-based cache.clear_voices_cache()now also resets_cached_provider._get_active_provider_name()helper to avoid duplicating the settings lookup.tests/test_tts_engine_cache.py— four new unit tests covering: same-provider cache hit, cache bust on Edge→Piper switch, cache bust on Piper→Edge switch, andclear_voices_cache()resetting provider tracking.💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.