In JavaScript, for text to speech, when the voiceschanged event was being listened to, nothing happened with an array of voices? [duplicate]
问题 This question already has answers here : Getting the list of voices in speechSynthesis (Web Speech API) (11 answers) Closed last month . Related to this text to speech question, I have the following code: First of all, I am not sure if this is the best way to write the code, because it is initializing, and then setting a listener to "call itself". (seems a little bit hacky). Second, although the listeners got "notified", the voices.length is still 0 . Nothing really happens with an array of