Commit 3b7f7c6e authored by Timothy J. Baek's avatar Timothy J. Baek
Browse files

fix: loop until voice list available

parent 9101c174
...@@ -618,7 +618,17 @@ ...@@ -618,7 +618,17 @@
gravatarEmail = settings.gravatarEmail ?? ''; gravatarEmail = settings.gravatarEmail ?? '';
speakVoice = settings.speakVoice ?? ''; speakVoice = settings.speakVoice ?? '';
await voices.set(await speechSynthesis.getVoices()); // await voices.set(await speechSynthesis.getVoices());
const getVoicesLoop = setInterval(async () => {
const _voices = await speechSynthesis.getVoices();
await voices.set(_voices);
// do your loop
if (_voices.length > 0) {
clearInterval(getVoicesLoop);
}
}, 100);
saveChatHistory = settings.saveChatHistory ?? true; saveChatHistory = settings.saveChatHistory ?? true;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment