Skip to content

feat(tts): finish audio export with atomic temp-file pipeline - #18

Merged
TimInTech merged 2 commits into
mainfrom
feature/tts-audio-export-atomic
Jun 22, 2026
Merged

feat(tts): finish audio export with atomic temp-file pipeline#18
TimInTech merged 2 commits into
mainfrom
feature/tts-audio-export-atomic

Conversation

@TimInTech

Copy link
Copy Markdown
Owner

Summary

This finishes the audio export flow in the TTS window.

Included in this PR:

  • Export button in the TTS window
  • Export to OGG/Opus and MP3
  • ffmpeg writes to a temp file in the target directory first
  • atomic os.replace(...) on successful export
  • dedicated temporary WAV file per synthesis job
  • cleanup for WAV/export temp files on success, error, cancel, and stop

Verification

  • targeted tests: 73 passed
  • full suite: 281 passed
  • compileall: ok
  • git diff --check: ok
  • Secret-Scan im Scope: ok
  • Runtime-Test: ./run.sh ok, OGG/MP3 per file/ffprobe geprüft

Review status

Codex read-only review could not be completed due to a usage-limit blocker, so an independent Codex second opinion is still outstanding.

Rollback

git revert dbb52ad

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dbb52ad99a

ℹ️ 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".

Comment thread app/tts_window.py Outdated
dir=str(target.parent),
)
os.close(fd)
_safe_unlink(temp_path)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Do not release the reserved ffmpeg temp name

When the user exports into a shared directory such as /tmp, this mkstemp result is immediately unlinked before ffmpeg is started, so the reserved pathname becomes available for another local process to recreate (for example via an inotify race and symlink) before ffmpeg opens it. That defeats the safety of the temp-file pipeline and can make ffmpeg write to an unintended file; keep the mkstemp path in place and let the existing -y overwrite/truncate that private temp file instead.

Useful? React with 👍 / 👎.

@TimInTech
TimInTech merged commit 2c72c30 into main Jun 22, 2026
7 checks passed
@TimInTech
TimInTech deleted the feature/tts-audio-export-atomic branch June 22, 2026 00:53
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