Simple text to speech module built on Web Speech API.
-
Try out a live demo of the component here
-
The NPM page can be found here
-
The GitHub page can be found here
run npm install speech-synth --save
in console while in root directory to add the component to your project.
Import the module buy using a requrie statement:
const speech = require('speech-synth');
or an import statement:
import speech from 'speech-synth';
- say:
- Description: convert text to speech
- Type: Method
- Params: (input, voiceURI)
- input -> String to be spoken
- voiceURI -> name of the voice to use
- Default:
'Google US English'
- Default:
- Return: none
speech.say('hello')
- getVoiceNames:
- Description: returns an array of all voiceURI options that can be used with the say method
- Type: Method
- Params: none
- Return: Array[String]
speech.getVoiceNames()
Example:
let voice = speech.getVoiceNames()[3];
speech.say('My voice is Google Deutsch', voice);
- Development Team Members:
- Alec Draymore