v1.10.4#288
Merged
Merged
Conversation
Handle Jeedom tts.php responses that return a file path: decode and strip response content, verify path with os.path.exists, and read file with a context manager. Replace several English log messages with French equivalents for consistency and improve debug formatting (use %d for length). Add missing "espeak" and "pico" entries to VSCode settings and bump plugin version to 1.10.3 in plugin_info.
Check HTTP response content from VoiceRSS for MP3 magic bytes before using it. The code now verifies status code and that response.content starts with ID3 or an MPEG sync frame (0xFF 0xE0+); if not, it logs a warning (showing up to 80 chars of the response) and avoids treating the payload as audio. Assigns filecontent only when valid and removes the previous unused/incorrect handling. This prevents non-MP3 API errors or HTML responses from being processed as audio.
Bump dependency versions in resources/requirements.txt: google-cloud-texttospeech 2.36.0 -> 2.37.0 and google-genai 2.8.0 -> 2.9.0. These upgrades bring minor fixes and improvements from the newer releases.
Upgrade JeedomTTS failure paths from warnings to errors in the daemon, including HTTP status failures and missing TTS files. Also make `TestTTS` and main `TTS` processing return `False` immediately when JeedomTTS output is invalid, so bad responses no longer continue as if successful.
Updates two error logs in `ttscastd.py` (`TestTTS` and `TTS`) to report that no audio file was generated, instead of the vaguer "incorrect output" message. This makes failure diagnostics more explicit when JeedomTTS returns no usable audio payload.
Updates plugin metadata to version 1.10.4 and adjusts Jeedom TTS daemon log messages to explicitly label Jeedom file paths/errors. This makes troubleshooting missing generated TTS files clearer in mixed TTS contexts.
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.
This pull request introduces several improvements and fixes to the TTS Cast plugin, focusing on better handling of TTS file generation, improved error detection and logging, and dependency updates. The main changes include more robust handling of JeedomTTS and VoiceRSS responses, clearer error messages (now in French for consistency), and dependency bumps for Google TTS libraries.
TTS file handling and error detection:
jeedomTTSmethod to properly decode and validate file paths returned by Jeedom, handle missing dependencies (like pico/espeak), and log detailed errors if the TTS file is not found.voiceRSSmethod to verify that responses are valid MP3 files by checking magic bytes, and to log warnings for invalid or unexpected responses.generateTestTTSandgetTTSto returnFalseand log an error if JeedomTTS does not generate an audio file, ensuring failures are detected and handled upstream. [1] [2]Error logging and messaging:
Dependency and configuration updates:
google-cloud-texttospeechto2.37.0andgoogle-genaito2.9.0inrequirements.txtfor improved compatibility and features..vscode/settings.jsonto add"espeak"and"pico"to the list of excluded files, reflecting the supported TTS engines. [1] [2]1.10.4inplugin_info/info.json.These changes make the TTS generation process more robust, improve diagnostics, and ensure the plugin is up-to-date with its dependencies.