Skip to content

Studio Translate: translate audio files - #18976

Merged
danielhanchen merged 1 commit into
mainfrom
translate-media-18666
Nov 23, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
translate-media-18666

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Related to #18666

Summary

The Translate page now takes audio files. Drop an audio file on the page, or pick one with the open file button, and it is transcribed with the speech-to-text model chosen in Settings > Voice. The transcript goes into the source box and is translated as usual: auto translate, history, the language picker and the prompt all work the same way as for typed text.

  • Transcription goes through the same request chat's audio upload already makes (transcribeAudioBlob with the Voice settings model and quant). Size limit (25 MB), empty file, no speech and "choose a model" errors reuse the existing dictation messages and their translations. A model that is not downloaded yet opens the existing STT download prompt.
  • While the file transcribes, the box shows the existing "Reading {name}..." state and drops are refused, as for documents. If the user types or picks a history entry meanwhile, the transcript is discarded instead of overwriting their text. Leaving the page cancels the request.
  • Accepted audio is the same list chat takes (.wav, .mp3, .m4a, .ogg, .opus, .flac, .aac, ... plus audio/* MIME types). Video files are not routed here.
  • The source box placeholder and the open file button now say "document, image or audio file", updated in all 25 locales.

Nothing changes for text, documents or images: an audio file is the only thing that takes the new branch, and a test checks that no currently accepted text, document or image extension is classified as audio. No backend change, no new dependency.

Images (part 1 of the issue)

Images already work today: an image dropped on Translate goes to /api/rag/extract-text, which reads it with the vision model loaded in Chat, or Tesseract when installed, and the text is translated. This PR leaves that path untouched.

Scoped out, and why

  • Translated text overlaid on the image. The OCR path returns plain text only, with no word or line boxes (the vision model returns free text), so there is nothing to place an overlay on. This needs a box-returning OCR step first and is better done as its own change.
  • SRT export of translated audio. The transcription request Translate uses returns text without segment timestamps, and translating a transcript as one block loses the cue timing anyway. Real subtitle translation means translating cue by cue against timestamped segments, which belongs in a follow-up. Existing .srt / .vtt files can already be opened on Translate as text.
  • Video subtitles and multi-language batch export. Out of scope for this first slice.

Test evidence

  • node --experimental-strip-types --test tests/translate-*.test.ts: 65 pass, 0 fail (includes the new tests/translate-audio-file.test.ts).
  • npm test (full frontend suite): 16972 tests, 16971 pass, 1 skipped, 0 fail.
  • npm run typecheck: no type errors.
  • eslint on the touched files: no new findings vs the base (translate-page.tsx keeps its 12 existing findings; the new file and test have none).
  • Not yet run end to end against a live Studio with a downloaded speech-to-text model; the transcription request itself is the one chat audio upload already sends.

Before / after

The Translate source box now says it takes audio files, and the file picker accepts audio (documents and images still work as before):

before and after

Audio files dropped on or opened from the Translate page are transcribed
with the speech-to-text model picked in Voice settings, the same request
chat's audio upload makes, and the transcript fills the text box to
translate as usual. Documents, images and text files keep their reader.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T02:04:41.054802Z 9a62f23 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@danielhanchen danielhanchen self-assigned this Nov 23, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 9a62f2385a

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

danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 23, 2026
@danielhanchen
danielhanchen merged commit 5a05f3e into main Nov 23, 2026
@danielhanchen
danielhanchen deleted the translate-media-18666 branch November 23, 2026 02:27
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