Skip to content

Commit 88c0aff

Browse files
committed
Fix TTS on iOS
I bet they serve apples in hell.
1 parent 4b4b2bd commit 88c0aff

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

js/tts.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/js/tts.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ if (typeof speechSynthesis !== 'undefined') {
3131
}, 2000);
3232

3333
// If they support the event, we clear the timeout
34-
fcn_synth.addEventListener('voiceschanged', () => {
35-
fcn_setupTTS();
36-
clearTimeout(fcn_ttsSetupTimeout);
37-
}, { once: true });
34+
if ('onvoiceschanged' in speechSynthesis) {
35+
fcn_synth.addEventListener('voiceschanged', () => {
36+
fcn_setupTTS();
37+
clearTimeout(fcn_ttsSetupTimeout);
38+
}, { once: true });
39+
}
3840
}
3941

4042
/**

0 commit comments

Comments
 (0)