Auto-sync: 2026-03-02 11:30:01

This commit is contained in:
Windmill Bot
2026-03-02 11:30:01 +00:00
parent 27854af3a7
commit 4666fa23fc
3 changed files with 20 additions and 23 deletions

View File

@@ -1,12 +1,16 @@
export async function main(device: string, text: string) {
const res = await fetch("http://alexa_api:3500/speak", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ device, text }),
});
if (!res.ok) {
const err = await res.json().catch(() => ({}));
throw new Error("alexa-api error " + res.status + ": " + JSON.stringify(err));
}
return await res.json();
}
const ssml = `
<speak>
<lang xml:lang="ja-JP">
${text}
</lang>
</speak>
`;
const res = await fetch("http://alexa_api:3500/speak", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
device,
ssml
}),
});