Auto-sync: 2026-03-02 12:00:01
This commit is contained in:
@@ -1,16 +1,27 @@
|
||||
const ssml = `
|
||||
<speak>
|
||||
<lang xml:lang="ja-JP">
|
||||
${text}
|
||||
</lang>
|
||||
</speak>
|
||||
`;
|
||||
export async function main(args: {
|
||||
device: string;
|
||||
text: string;
|
||||
}) {
|
||||
|
||||
const res = await fetch("http://alexa_api:3500/speak", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({
|
||||
device,
|
||||
ssml
|
||||
}),
|
||||
});
|
||||
console.log("ARGS:", args);
|
||||
|
||||
const ssml = `<speak><lang xml:lang="ja-JP">${args.text}</lang></speak>`;
|
||||
|
||||
const res = await fetch("http://alexa_api:3500/speak", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({
|
||||
device: args.device,
|
||||
text: ssml
|
||||
}),
|
||||
});
|
||||
|
||||
const body = await res.text();
|
||||
console.log("API RESPONSE:", body);
|
||||
|
||||
if (!res.ok) {
|
||||
throw new Error("alexa-api error " + res.status + ": " + body);
|
||||
}
|
||||
|
||||
return body;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user