feat: client-side TTS warmup after feed load
This commit is contained in:
parent
1353d455e4
commit
dcdac89470
11
index.html
11
index.html
|
|
@ -1006,6 +1006,17 @@ async function loadFeed() {
|
||||||
});
|
});
|
||||||
speechQueue.push('本日のブリーフィングは以上です。');
|
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}件`;
|
document.getElementById('briefCount').textContent = `${list.length}件`;
|
||||||
updateArticleDisplay(list[0], 0);
|
updateArticleDisplay(list[0], 0);
|
||||||
renderList();
|
renderList();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue