feat(audio): choose a male or female local voice per language
The installer now fetches one male and one female Piper voice per language (Swedish NST/Lisa, English Ryan/Lessac), with genders confirmed by measuring each voice's pitch rather than guessed from the name. Settings -> Audio gets a voice selector per language with its own Test button that always plays the Piper voice. Male is preselected for both. The integration test now runs its server with an empty home directory, so voices installed on the developer's own machine can't leak into it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -18,7 +18,7 @@ export function isPiperSpeaking() {
|
||||
}
|
||||
|
||||
// Returns true when the line was accepted (it will play via Piper or the fallback).
|
||||
export function speakWithPiper(text, { language, rate, volume = 1, interrupt, onEnd, onError, fallback }) {
|
||||
export function speakWithPiper(text, { language, voice = "", rate, volume = 1, interrupt, onEnd, onError, fallback }) {
|
||||
if (current && !interrupt) return false;
|
||||
stopPiperSpeech();
|
||||
const job = { cancelled: false, controller: new AbortController(), audio: null, url: "" };
|
||||
@@ -32,7 +32,7 @@ export function speakWithPiper(text, { language, rate, volume = 1, interrupt, on
|
||||
fetch("/api/tts/speech", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ text, language, rate }),
|
||||
body: JSON.stringify({ text, language, voice, rate }),
|
||||
signal: job.controller.signal,
|
||||
})
|
||||
.then((response) => {
|
||||
|
||||
Reference in New Issue
Block a user