Created
April 15, 2019 23:56
-
-
Save VeronicaM/33cdf823a9f0177c8a87c9128eca620e to your computer and use it in GitHub Desktop.
Utter word in course language with Web Speech API
This file contains 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
const courseLang = CurrentUserService.getLangCourseCode(); | |
const voice = SpeechSynthesisService.getVoices().find((voice) => voice.lang.indexOf(courseLang) > -1); | |
SpeechSynthesisService.speak(this.props.value, { | |
lang: courseLang, | |
voice: voice.name, | |
rate: 1.0, | |
pitch: 1.0, | |
volume: 1.0 | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment