feat: OpenAI Cloud-TTS als optionale Vorlese-Engine - #10
Merged
Conversation
Ergaenzt das Vorlese-Fenster um einen optionalen OpenAI-Cloud-TTS-Anbieter neben dem lokalen Piper (Default). Synthese laeuft non-blocking in einem QThread mit 30s-Timeout; Wiedergabe ueber die bestehende paplay/aplay-Kette. - config: tts_provider (piper|openai), tts_openai_model, tts_openai_voice, tts_openai_consent inkl. Validierung + Sanitize - tts_window: CloudTtsService, _CloudTtsWorker, Anbieter-/Modell-UI, einmaliger Datenschutz-Dialog (persistente Zustimmung), secret-sichere Fehlertexte, robuster Thread-Abbruch mit referenzgehaltenem Detach (kein "QThread destroyed while running") - Tests: +14 (Speed-Mapping, Synthese, Consent-Gate, Secret-Scrub, Detach-Timeout-Pfad) - README: Anbieterwahl und neue Config-Felder dokumentiert Key kommt ausschliesslich aus OPENAI_API_KEY (secrets.env), nie aus config.json. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AHu5E1iQWEa6LViTcdo3o7
- Audio-Export transkribierter Texte als versandfreundliche Datei (OGG/Opus bzw. MP3) fuer Sprachnachrichten (WhatsApp o.Ae.) - Leichter Launch-Smoke-Test, damit CI den realen App-Start bestaetigt Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AHu5E1iQWEa6LViTcdo3o7
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c24bd669b8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…d leak, scrub_secret)
This was referenced Jun 19, 2026
This was referenced Jul 1, 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.
Ziel
Optionale Cloud-basierte Vorlese-Engine (OpenAI TTS) als Alternative zum lokalen Piper. Piper bleibt Default; Cloud-TTS ist opt-in und erst nach ausdrücklicher Datenschutz-Zustimmung aktiv.
Änderungen
app/config.py: drei nicht-geheime Felder + Validierung —tts_provider(piper|openai, Defaultpiper),tts_openai_model(Defaultgpt-4o-mini-tts),tts_openai_voice(Defaultmarin, Whitelist von 13 Stimmen),tts_openai_consent(bool, Defaultfalse).app/tts_window.py:CloudTtsService— Synthese viaopenai.audio.speech.create(..., timeout=30), Wiedergabe über die bestehende_playback_command()-Pipeline (paplay/aplay)._CloudTtsWorker(QThread) — nicht-blockierende Synthese; Status „Wiedergabe…" mit aktiven Pause/Stopp/Nochmal-Aktionen._ensure_openai_consent); bei Ablehnung Revert auf Piper._scrub_secret)._detached_cloud_threadsreferenziert und erst beifinishedvia_on_detached_thread_finished→deleteLaterfreigegeben (verhindert „QThread destroyed while running").README.md/ROADMAP.md: Doku zur Cloud-TTS-Option.Secret-Modell
Wie bei OpenRouter/OpenAI-LLM: nur der Env-Var-Name steht in
config.json; der Key liegt in~/.config/blitztext-linux/secrets.env(mode0600). Keine Secrets im Repo.Datenschutz
Cloud-TTS sendet den vorzulesenden Text an OpenAI. Aktivierung ausschließlich nach explizitem Consent-Dialog; Zustimmung wird persistiert, Ablehnung fällt auf Piper zurück.
Testplan
QT_QPA_PLATFORM=offscreen WHISPER_GUI_TESTS=1)openai-Paket / Thread-Detach bei hängendem Netzaufrufgpt-4o-mini-tts/ Stimmenova/ Tempo „Schnell", Playback + Pause/Stopp/Nochmal verifiziertBekannte Nachzieher (separat, nicht in diesem PR)
is_available()ignoriert fehlendesopenai-Paket (UI „bereit" irreführend);tts_openai_modelohne Whitelist; Install-Hint trennt Key-fehlt/Paket-fehlt nicht; OpenAI-Client-Init-Timeout. Sind als eigene Roadmap-Items erfasst.🤖 Generated with Claude Code