-1

I’m building an app with the React JS library, using Electron and Node JS to package it as a Windows .exe

I used the “speak-tts” module to integrate speech synthesis. Everything seems to be pretty straightforward, but I can’t figure out how to load additional voices. I can only get the default voice.

Has anyone else come across this issue? Your advice is much appreciated.

C-Los FX
  • 61
  • 1
  • 12

2 Answers2

3

I'm the creator of the speak-tts module. As you can see in the documentation (https://www.npmjs.com/package/speak-tts) there is a setVoice() method that you can call on your instance to change the voice on the fly. You can get the list of available voices in the browser from the onvoiceschanged listener. Also there might be specific issues with Electron and this package that I'm not aware of. If so do not hesitate to create a github issue (https://github.com/tom-s/speak-tts/issues).

tom-s
  • 31
  • 2
-1

Easiest way to do is use plain JS methods

For reference.

https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis/cancel

It has all the required methods. cancel(), start(), pause() etc

Rohit Parte
  • 3,365
  • 26
  • 26