v0.9.4「中文用户名不再背锅」/ "Chinese usernames are off the hook"
来自 #4 的用户反馈:Windows 中文用户名下转写必失败,只甩一句「Please check your config!」;想把模型搬到别的盘自救,又被「目标目录在当前模型目录内部」拦住。两个问题同出一源,这版一起修掉。
🀄 中文用户名下转写必失败 → 修复
语音引擎(sherpa-onnx)的原生层在 Windows 上按 ANSI 方式打开文件——模型放在 C:\Users\中文名\AppData\Roaming\hotclip\models 这类含中文的路径下时,路径被系统代码页误解,模型文件一个字节都读不到,引擎创建直接失败。模型下载、设置页清点走的是应用自身的文件接口(宽字符),所以一切显示正常、唯独一转写就炸,极具迷惑性。
- 模型路径自动转 Windows 8.3 短路径(每段都是纯 ASCII)再交给语音引擎,中文用户名/中文目录畅通无阻
- 音频样本改由应用侧读入内存直接喂给引擎,不再让原生层自己去开临时文件(临时目录同样在中文用户名下)
- 说话人分离(多人对谈)模型路径同样收治
🚚 跨盘搬模型被误拦 → 修复
设置页「更换位置」时,任何跨盘目标(如 C 盘 → E 盘)都被误判成「目标目录在当前模型目录内部」而被拒绝——恰恰是遇到上面问题时最需要的自救路径。现在跨盘搬家正常走「完整复制 → 字节校验 → 才删原件」的安全流程。
🩺 模型加载失败的对症提示
若模型加载仍然失败(路径实在转不了短路径、或模型文件真的损坏),不再是一句天书,而是明确告诉你:把模型位置换到纯英文路径(设置 → 模型存放位置),或删除该模型文件夹后重新转写自动重下。
⬆️ 升级方式
到 Releases 下载新安装包覆盖安装即可。已下载的模型、词表、偏好原位保留,不会重新下载任何东西。等不及升级的 0.9.3 用户也可临时启用系统「Beta: 使用 Unicode UTF-8 提供全球语言支持」绕过(区域设置,需重启)。
From #4: on Windows accounts with a Chinese (non-ASCII) username, transcription always failed with a bare "Please check your config!" — and trying to move the models to another drive to escape got blocked by "target folder is inside the current model folder". One root cause, both fixed in this release.
🀄 Transcription always failing under non-ASCII usernames → fixed
The speech engine's (sherpa-onnx) native layer opens files via ANSI on Windows. With models under C:\Users\中文名\AppData\Roaming\hotclip\models, the path gets mangled by the system codepage, not a single model byte can be read, and recognizer creation fails outright. Downloads and the Settings inventory use the app's own (wide-char) file APIs, so everything looked installed and ready — only transcription blew up.
- Model paths are auto-converted to Windows 8.3 short paths (every component plain ASCII) before reaching the engine
- Audio samples are read app-side into memory and fed to the engine directly — the native layer no longer opens temp files itself (the temp dir lives under the same non-ASCII home)
- Speaker-diarization model paths get the same treatment
🚚 Cross-drive model moves wrongly blocked → fixed
In Settings → model storage, any cross-drive target (e.g. C: → E:) was misjudged as "inside the current model folder" and refused — exactly the escape route you'd want for the bug above. Cross-drive moves now run the normal safe path: full copy → byte verification → only then remove the original.
🩺 Actionable errors when model loading still fails
If loading still fails (short-path conversion unavailable, or genuinely corrupt model files), the error now tells you what to do: move the model folder to an ASCII-only path (Settings → Model storage), or delete that model's folder and transcribe again to re-download.
⬆️ Upgrading
Grab the new installer from Releases and install over the top — models, glossaries and preferences stay put, nothing re-downloads. On 0.9.3, enabling Windows' "Beta: Use Unicode UTF-8 for worldwide language support" (region settings, reboot required) also works as a stopgap.