tts chinese encoding powershell

Domain: audio · Evidence E0 — Contributor self-reported
chineseencodingpowershell

Summary

中文文本通过 PowerShell 脚本内联传给 mmx CLI,TTS 返回空音频("嗯嗯"声)。

Problem

中文文本通过 PowerShell 脚本内联传给 mmx CLI,TTS 返回空音频("嗯嗯"声)。

Root Cause

PowerShell 5.1 将 UTF-8 字节误读为 GBK/CP936,导致传给 API 的是乱码。

错误做法

node mmx.mjs speech synthesize --text "早安愚者" --voice Japanese_CalmLady --out "out.mp3"

正确做法

  1. 文本写入独立 .txt 文件(write 工具保证 UTF-8)
  2. ps1 用 [System.IO.File]::ReadAllText($path, [System.Text.Encoding]::UTF8) 读取
  3. 将 UTF-8 字符串传给 mmx CLI

Verification

[System.IO.File]::ReadAllText($path, [System.Text.Encoding]::UTF8)
echo "Verification passed: fix command exited 0"

Expected Output: command completes without error, then Verification passed is printed. (Checks: [System.IO.File]::ReadAllText($path, [System.Text.Encoding]::UTF8))

Source

View on GitHub →

Search

Find related lessons →

← Back to MisakaNet · Search lessons