media-use transcribe.mjs: add --language so non-English audio isn't translated by small.en

未关闭 适合新手
#7,371 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@sx4im 已经在做这个了。

开始于 2026年11月7日。

  • #7372 来自 @sx4im —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
88/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃

调研方向

从skills/media-use/scripts/transcribe.mjs入手,追踪其选项如何被解析并传递给hyperframes transcribe命令。然后阅读skills/media-use/audio/references/transcribe.md,了解现有的模型和语言指南。完成标准是:脚本接受可选的--language值,将其传递给CLI,并记录其用法。

由索引模型根据 Issue 内容生成。

描述

Problem

skills/media-use/scripts/transcribe.mjs has no way to pass a language to the CLI, so non-English audio outside Parakeet's 25 languages (Thai, Japanese, Chinese, Korean, ...) comes back translated into English.

  • Its options are --input, --out, --engine, --model, --json and --help (transcribe.mjs#L32-L43). --model only reaches parakeet-mlx (#L113).
  • The CLI fallback runs hyperframes transcribe <input> --dir <tmp> --engine <engine> --json with no --language and no --model (#L137).
  • With no language, the CLI uses its default whisper model small.en (packages/cli/src/whisper/manager.ts, DEFAULT_MODEL), which is English-only. whisper.cpp then translates Thai speech into English instead of transcribing it.

The CLI itself handles this well: --language th makes initialModelForLanguage swap small.en for multilingual small, and pickRunner routes to whisper because parakeetSpeaks("th") is false. The skill script just never passes it.

Repro (v0.9.20, macOS):

say -v Kanya -o th.aiff "สวัสดีครับ วันนี้อากาศดีมาก"
ffmpeg -i th.aiff -ar 16000 -ac 1 th.wav
npx hyperframes transcribe th.wav --dir . --json                 # small.en, which skills/hyperframes/references/captions.md says translates non-English speech
npx hyperframes transcribe th.wav --dir . --json --language th   # engine whisper, model small: Thai text
node skills/media-use/scripts/transcribe.mjs --input th.wav       # no way to get the second result
Proposed solution

Add a --language option to transcribe.mjs and forward it to the CLI call:

language: { type: "string" }, // ISO 639-1, e.g. th, ja; omit for auto
// ...
["hyperframes", "transcribe", inputPath, "--dir", workDir, "--engine", cliEngine, "--json",
 ...(args.language ? ["--language", args.language] : [])],

Then mention it in skills/media-use/audio/references/transcribe.md next to the CLI's --model small --language <code> guidance, so an agent that already knows the language can pass it through the script too.

Alternatives considered
  • A shell wrapper around npx that appends --language: it works for typed commands, but execFileSync skips shell functions, so it never reaches this script.
  • An env var such as HYPERFRAMES_TRANSCRIBE_LANGUAGE read by the CLI: this would cover every caller, but it's a bigger change than one forwarded flag.
Additional context

hyperframes CLI 0.9.20, installed as the Claude Code plugin. Same code on main at 896a77c.

主要语言
TypeScript
星标
54.1k
派生
4.9k
平均合并
7 小时
30 天内合并 PR
799

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

heygen-com/hyperframes 的其他 Issue

查看 heygen-com/hyperframes 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。