fix:windows voices is empty

This commit is contained in:
tk103331 2023-03-06 12:48:22 +08:00
parent 488e249193
commit fa96092728

View File

@ -12,6 +12,11 @@ export default function General() {
useInit(async () => {
setPlatform(await platform());
speechSynthesis.addEventListener('voiceschanged', () => {
const voices = speechSynthesis.getVoices();
console.log(voices);
setVoices(voices);
});
setVoices(speechSynthesis.getVoices());
});