feat: client-side TTS warmup after feed load

This commit is contained in:
posimai 2026-03-22 23:39:28 +09:00
parent 1353d455e4
commit dcdac89470
1 changed files with 11 additions and 0 deletions

View File

@ -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();