Skip to content

v1.11.0#289

Merged
TiTidom-RC merged 32 commits into
betafrom
dev
Jul 4, 2026
Merged

v1.11.0#289
TiTidom-RC merged 32 commits into
betafrom
dev

Conversation

@TiTidom-RC

Copy link
Copy Markdown
Owner

This pull request introduces full integration of the Piper TTS engine as a local/offline text-to-speech option, including UI, backend, and dependency management updates. It adds Piper voice selection and model management in the configuration, handles Piper-specific actions in the backend, and ensures the correct dependencies and files are managed for Piper usage.

Piper TTS Integration

  • Added Piper TTS as a selectable engine in the configuration UI, with grouped local/cloud options and a dedicated section for Piper voice selection, speaker ID (for multi-speaker models), and real-time model download/progress status. The UI loads the voice catalog from piper_voices.json and allows refreshing the catalog via the daemon. [1] [2]
  • Implemented backend AJAX actions in ttscast.ajax.php for Piper: fetching voices, downloading models, checking download status, refreshing the catalog, verifying model presence, and deleting models.
  • Extended the TTS command pipeline in ttscast.class.php to include Piper-specific parameters (piperVoiceName, piperSpeakerId) in all relevant methods (deamon_start, playTestTTS, generateTTS, playTTS). [1] [2] [3] [4]
  • Updated dependency management to include piper-tts requirements when Piper is the active engine, and to trigger dependency reevaluation on engine change. [1] [2] [3]
  • Excluded Piper model files from backups and added a placeholder README in the models directory. [1] [2]

Other improvements

  • Added new terms related to Piper TTS to .vscode/settings.json for spell checking or code intelligence. [1] [2]
  • Fixed a minor bug in dependency checking by casting counts to integers for comparison.

These changes provide a robust, user-friendly way to use Piper TTS locally, manage its models, and ensure the system remains maintainable and up-to-date.

TiTidom-RC added 30 commits July 4, 2026 14:55
Update the plugin metadata version in `plugin_info/info.json` for the new release.
Integrates offline Piper TTS across the plugin: new engine selection in configuration, voice/language filtering, speaker ID support, model status display, catalog refresh, and model download progress from the UI. The core and daemon now pass Piper voice/speaker settings, generate/play Piper WAV output, support lazy model loading with in-memory model caching, and expose new socket/AJAX commands for catalog/model handling. Dependency handling was updated to install Piper packages only when Piper is enabled, and model artifacts were excluded from git/backup with a dedicated data/models folder.
Updates the Piper TTS configuration UI to make catalog actions more compact and contextual: the catalog refresh action is now attached to the language selector, the empty-catalog info message is shorter and less prominent, and column widths were adjusted for speaker ID and model action controls for a cleaner form layout.
Use rounded input-group edge classes on the Piper language selector and refresh button so the control renders with matching borders in the configuration page.
Simplify the TTS engine dropdown labels in the plugin configuration page for better readability.
Consolidate language filtering and voice selection into a single dropdown with optgroups instead of two separate steps. Improve catalog refresh experience with spinner feedback and dynamic UI rebuild via new _piperRebuildSelects() function. Removes redundant language detection logic and piperFilterVoices() function.
Improves observability around TTS configuration changes by logging `postConfig_ttsEngine` calls in PHP, including the updated `pythonDepNum` value after dependency refresh. Also adds daemon startup logs for Piper voice, speaker ID, and Piper availability to simplify diagnosis of Piper-related setup and runtime issues.
Reworked the Piper settings layout by moving the model download action into the voice row and placing the speaker ID row after it for a cleaner flow. Also trigger `piperOnVoiceChange()` when switching to Piper TTS so model state/UI updates immediately, and stop showing the explicit “À télécharger” status label in favor of the download button state.
Add a dedicated `PiperLogFilter` in `ttscastd.py` and attach it to the `piper` logger so messages are prefixed with `[PIPER]`. This makes Piper-related logs easier to identify in mixed daemon logs without changing existing log level behavior.
Adds a detailed debug line during Python dependency verification to log found vs expected package counts and the dependency string being checked. This improves troubleshooting when dependency checks report missing modules.
Cast dependency counters to integers before comparing found vs expected Python packages, avoiding string-based comparison edge cases. Also clear Jeedom's dependency cache in `postConfig_ttsEngine` so the dependencies badge is immediately refreshed after changing the TTS engine.
Remove three debug log statements that were used for tracking Python dependency resolution during engine changes. These logs are no longer needed for normal operation and reduce log verbosity.
Update the test TTS filename hash input to include `piperSpeakerId` along with text and voice. This prevents cache collisions where different Piper speakers could previously reuse the same generated WAV file.
Changed the Piper model download button from a green success button (btn-sm) to a warning button (btn-xs), and updated the label from 'Télécharger le modèle' (Download the model) to 'Télécharger la voix' (Download the voice) for better clarity and visual hierarchy.
Reduce top margin and add bottom margin to the piper model status element for better spacing.
Remove the extra top margins around the Piper download button and progress block so the configuration UI is more compact.
Wrap the Piper model status, download button, and progress UI in a shared container so the controls align consistently and keep the progress label grouped with the download bar.
Replace vertical margins with padding on the Piper model status block to keep spacing consistent without affecting surrounding layout.
Set the piper_model_status element to display as a block to ensure proper layout separation from adjacent elements, particularly the download button.
Add overflow:hidden CSS property to the Piper model status container to prevent content overflow issues with the status message and download button.
Remove unnecessary wrapper div and apply margins directly to child elements. This reduces DOM nesting and improves markup clarity without changing the visual layout.
Reduce the top margin around the Piper model status, download button, and progress area to make the configuration layout more compact.
Replace static Piper voice download button with dynamic creation. The button is now generated on-demand when checking model status and embedded directly in the status element, improving maintainability and reducing DOM overhead. Event listeners are attached to dynamically created buttons instead of being set up once at initialization.
Implement ability to delete locally downloaded Piper voice models via UI. Includes backend validation of voice keys and cleanup of .onnx and .onnx.json files, plus frontend delete button with confirmation dialog.
Changed the Piper model delete button from a `.btn` class to a `.label` class for visual consistency with the success indicator. Added `cursor:pointer` style to indicate it's clickable. Functionality remains unchanged.
Use Jeedom's jeeDialog.confirm() instead of the browser's native confirm() dialog for better UI consistency. Also added pointer-events:none to the trash icon to prevent independent clicks, ensuring the entire button triggers the action.
Replace <span> with <a> tag for the delete button, improving semantic HTML. Remove unnecessary cursor:pointer style (inherited by <a>) and pointer-events:none from the icon.
Change the Piper voice model delete button from label styling to proper button styling using Bootstrap classes (btn btn-danger btn-xs) for better visual consistency.
Re-initialize Jeedom tooltips after rendering the local model status in the Piper UI so the newly injected delete button gets the expected hover behavior.
Updates the local voice status UI copy to refer to downloaded voices instead of local models, including the delete tooltip and confirmation prompt.
Adjust Piper logging so the `[PIPER]` prefix is only added for records from `piper*` loggers. Instead of attaching the filter only to the `piper` logger, the filter is now added to root handlers to catch propagated Piper records consistently while avoiding prefixing unrelated logs.
@TiTidom-RC
TiTidom-RC merged commit f27bf3d into beta Jul 4, 2026
5 checks passed
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.

1 participant