zhiftyDK / voiceassistant

https://codezhifty.github.io/voiceassistant/
3 stars 0 forks source link

Feedback #2

Open Drimdave opened 2 years ago

Drimdave commented 2 years ago

Hi bro, Is it possible to change the language being spoken by Eva? Also, can multiple languages be added?

zhiftyDK commented 1 year ago

@Drimdave Yes it is possible if you look at "voices google speechsynthesis api" on google

zhiftyDK commented 1 year ago

@Drimdave You can also do it like this

//Get and apply voices to the speak function let voices; window.speechSynthesis.addEventListener("voiceschanged", () => { voices = window.speechSynthesis.getVoices(); }); function speak(input) { var utterance = new SpeechSynthesisUtterance(input); utterance.voice = voices[6]; window.speechSynthesis.speak(utterance); }

Drimdave commented 1 year ago

Thank you so much.