Closed tariq86 closed 6 years ago
Thanks that's great ! I'll give it a go when I've got a bit of time, and build a new version if it all works.
Thanks for you input (and sorry for the delay), your contribution has been included in version 1.1.0 (available on npm)
This PR adds a
setVoice
method, which adds support for multiple voices for languages that have multiple voices. For example, language codeen-US
on macOS currently has 4 languages: "Alex", "Fred", "Samantha", and "Google US English". Using the existingsetLanguage
method is always using voice "Alex", since it is the first voice for that language code. You can now use the newsetVoice
method to use any of the other available voices.New Method:
setVoice(voice)
, wherevoice
can be:window.speechSynthesis.getVoices()
)SpeechSynthesisVoice
object (as returned bywindow.speechSynthesis.getVoices()
)