bunmicro 0.8.1 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/package.json +1 -1
- package/src/index.js +15 -2
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -3863,6 +3863,16 @@ class App {
|
|
|
3863
3863
|
this.message = `TTS_PITCH = ${tpv}`;
|
|
3864
3864
|
break;
|
|
3865
3865
|
}
|
|
3866
|
+
case "ttslang": {
|
|
3867
|
+
if (cmdArgs.length === 0) {
|
|
3868
|
+
this.message = `TTS_LANG = ${Bun.env.TTS_LANG ?? "zh-TW"}`;
|
|
3869
|
+
break;
|
|
3870
|
+
}
|
|
3871
|
+
|
|
3872
|
+
Bun.env.TTS_LANG = String(cmdArgs[0]);
|
|
3873
|
+
this.message = `TTS_LANG = ${Bun.env.TTS_LANG}`;
|
|
3874
|
+
break;
|
|
3875
|
+
}
|
|
3866
3876
|
case "help": {
|
|
3867
3877
|
const helpsplit = this.context?.config?.globalSettings?.helpsplit ?? "hsplit";
|
|
3868
3878
|
let helpHsplit = helpsplit !== "vsplit";
|
|
@@ -4410,7 +4420,7 @@ function ansiMagenta(text) { return ansiWrap("95", text); }
|
|
|
4410
4420
|
|
|
4411
4421
|
const COMMAND_NAMES = [
|
|
4412
4422
|
"set", "setlocal", "show", "get", "open", "open!", "save", "quit", "q", "exit", "goto", "comment", "find", "replace", "replaceall",
|
|
4413
|
-
"cd", "pwd", "tab", "run", "vsplit", "hsplit", "term", "tts", "ttsspeed", "ttspitch", "reopen", "theme", "toggle", "tog",
|
|
4423
|
+
"cd", "pwd", "tab", "run", "vsplit", "hsplit", "term", "tts", "ttsspeed", "ttspitch", "ttslang", "reopen", "theme", "toggle", "tog",
|
|
4414
4424
|
"togglelocal", "reset", "jump", "tabmove", "tabswitch", "textfilter", "bind", "unbind", "reload", "lintlog", "act", "action", "raw",
|
|
4415
4425
|
"help", "plugin", "showkey", "memusage", "retab", "eval",
|
|
4416
4426
|
];
|
|
@@ -4849,6 +4859,9 @@ function detectTtsCmd() {
|
|
|
4849
4859
|
const speed = parseFloat(Bun.env.TTS_SPEED) || 1.5;
|
|
4850
4860
|
Bun.env.TTS_PITCH = String(pitch);
|
|
4851
4861
|
Bun.env.TTS_SPEED = String(speed);
|
|
4862
|
+
|
|
4863
|
+
const lang = Bun.env.TTS_LANG || 'zh-TW'
|
|
4864
|
+
Bun.env.TTS_LANG = lang ;
|
|
4852
4865
|
|
|
4853
4866
|
if (platform === "android") {
|
|
4854
4867
|
if (runSync(["sh", "-c", "command -v termux-tts-speak"], { stdout: "ignore", stderr: "ignore" }).ok)
|
|
@@ -4878,7 +4891,7 @@ function detectTtsCmd() {
|
|
|
4878
4891
|
`$s = New-Object System.Speech.Synthesis.SpeechSynthesizer; $s.Rate = ${rate}; ` +
|
|
4879
4892
|
`$t = [Console]::In.ReadToEnd(); ` +
|
|
4880
4893
|
`$x = [System.Security.SecurityElement]::Escape($t); ` +
|
|
4881
|
-
`$s.SpeakSsml('<speak version="
|
|
4894
|
+
`$s.SpeakSsml('<speak xml:lang="${lang}" version="1.0" xmlns="http://www.w3.org/2001/10/synthesis"><prosody pitch="${pitchAttr}">' + $x + '</prosody></speak>')`;
|
|
4882
4895
|
return { cmd: [shell, "-NoProfile", "-Command", psCmd], via: "stdin" };
|
|
4883
4896
|
}
|
|
4884
4897
|
}
|