-
-
Save kimitaka/7792578d70cb16c539de9e1b2e49a17f to your computer and use it in GitHub Desktop.
Licensed under CC0 (https://creativecommons.org/publicdomain/zero/1.0/deed)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener('onEventReceived', function(obj) { | |
const synth = window.speechSynthesis; | |
if (obj.detail.command === 'PRIVMSG') { | |
var utter = new SpeechSynthesisUtterance(obj.detail.body); | |
utter.voice = synth.getVoices().filter(v => v.lang === 'ja-JP')[0]; | |
utter.rate = 1; | |
utter.pitch = 1; | |
synth.speak(utter); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment