tweak(mi-voice): quiet feminine — Emma, volume 0.25, neutral pitch

User preference: quiet + feminine. Swap Andrew (male) for Emma
(calmer, softer female than Aria). Drop volume 0.3 -> 0.25, reset
pitch to natural (deeper shift made it sound male). Rate stays slow.
This commit is contained in:
Jeff Emmett 2026-04-16 15:51:31 -04:00
parent 07b4714f48
commit dd608f831c
1 changed files with 4 additions and 4 deletions

View File

@ -30,7 +30,7 @@ export class MiVoiceBridge {
constructor(opts: MiVoiceBridgeOptions = {}) { constructor(opts: MiVoiceBridgeOptions = {}) {
this.#bridgeUrl = opts.bridgeUrl ?? DEFAULT_BRIDGE; this.#bridgeUrl = opts.bridgeUrl ?? DEFAULT_BRIDGE;
this.#voice = opts.voice ?? "en-US-AndrewMultilingualNeural"; this.#voice = opts.voice ?? "en-US-EmmaMultilingualNeural";
this.#onStateChange = opts.onStateChange ?? null; this.#onStateChange = opts.onStateChange ?? null;
} }
@ -191,7 +191,7 @@ export class MiVoiceBridge {
const res = await fetch(`${this.#bridgeUrl}${TTS_PATH}`, { const res = await fetch(`${this.#bridgeUrl}${TTS_PATH}`, {
method: "POST", method: "POST",
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
body: JSON.stringify({ text, voice: this.#voice, volume: 0.3, rate: "-10%", pitch: "-6Hz" }), body: JSON.stringify({ text, voice: this.#voice, volume: 0.25, rate: "-8%", pitch: "+0Hz" }),
}); });
if (!res.ok) { if (!res.ok) {
ws.removeEventListener("message", handler); ws.removeEventListener("message", handler);
@ -224,8 +224,8 @@ export class MiVoiceBridge {
this.#speakResolve = resolve; this.#speakResolve = resolve;
const utterance = new SpeechSynthesisUtterance(text); const utterance = new SpeechSynthesisUtterance(text);
utterance.rate = 0.95; utterance.rate = 0.95;
utterance.pitch = 0.85; utterance.pitch = 1.0;
utterance.volume = 0.3; utterance.volume = 0.25;
utterance.onend = () => { utterance.onend = () => {
this.#speakResolve = null; this.#speakResolve = null;
resolve(); resolve();