Auto-sync: 2026-03-02 12:00:01
This commit is contained in:
@@ -2,8 +2,21 @@ summary: Echo デバイスに TTS で読み上げ
|
||||
description: 指定した Echo デバイスにテキストを読み上げさせる
|
||||
lock: '!inline u/admin/alexa_speak.script.lock'
|
||||
kind: script
|
||||
no_main_func: true
|
||||
schema:
|
||||
type: object
|
||||
properties: {}
|
||||
required: []
|
||||
properties:
|
||||
args:
|
||||
type: object
|
||||
description: ''
|
||||
default: null
|
||||
properties:
|
||||
device:
|
||||
type: string
|
||||
description: ''
|
||||
originalType: string
|
||||
text:
|
||||
type: string
|
||||
description: ''
|
||||
originalType: string
|
||||
required:
|
||||
- args
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ locks:
|
||||
f/weather/weather_sync__flow+気象データ取得・同期.py: 86c9953ec7346601eaa13c681e2db5c01c9a5b4b45a3c47e8667ad3c47557029
|
||||
g/all/setup_app__app+__app_hash: d71add32e14e552d1a4c861c972a50d9598b07c0af201bbadec5b59bbd99d7e3
|
||||
g/all/setup_app__app+change_account.deno.ts: 3c592cac27e9cdab0de6ae19270bcb08c7fa54355ad05253a12de2351894346b
|
||||
u/admin/alexa_speak: 4dd06cef8078329a29df7d1c838f3f9495486cdef25d684d72cd26ea8522107c
|
||||
u/admin/alexa_speak: 73022478d7d9a8e238add4bc5a8aa7329a2f7d81864daa8acd881190c8c37ef5
|
||||
u/admin/hub_sync: aaf9fd803fa229f3029d1bb02bbe3cc422fce680cad39c4eec8dd1da115de102
|
||||
u/antigravity/git_sync__flow+__flow_hash: 5a7194ef6bf1ce5529e70ae74fdb4cd05a0da662c78bfa355bb7e98698689ae6
|
||||
u/antigravity/git_sync__flow+a.sh: ac7fdc83548f305fed33389129b79439e0c40077ed39a410477c77d08dca0ca9
|
||||
|
||||
Reference in New Issue
Block a user