From dcdac8947089fe2c1df85e79277c4e073d62f9c1 Mon Sep 17 00:00:00 2001 From: posimai Date: Sun, 22 Mar 2026 23:39:28 +0900 Subject: [PATCH] feat: client-side TTS warmup after feed load --- index.html | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/index.html b/index.html index 7c02dd0..1c28207 100644 --- a/index.html +++ b/index.html @@ -1006,6 +1006,17 @@ async function loadFeed() { }); speechQueue.push('本日のブリーフィングは以上です。'); + // APIキーがあれば表示中の記事をバックグラウンドでウォームアップ + const warmupKey = localStorage.getItem('posimai-brief-apikey'); + if (warmupKey) { + const texts = speechQueue.map(t => preprocessText(t)); + fetch(API_BASE + '/tts/warmup', { + method: 'POST', + headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${warmupKey}` }, + body: JSON.stringify({ texts, speaker: ttsSpeaker }), + }).catch(() => {}); + } + document.getElementById('briefCount').textContent = `${list.length}件`; updateArticleDisplay(list[0], 0); renderList();