npm i rtts
rtts is an open source JavaScript package for text to speech conversion
example usage
const rtts = require('rtts');
(async()=>{
rtts.rate=2.1
rtts.vol=100
await rtts.talk('hi');
})()
Options
A value between 0-100
rtts.vol
A value between 0-100
rtts.rate
saves output as .wav in given dir .if no dir is given it will store output as example.wav in CW
rtts.exportWav(text,dir)
function will repeat every intervel until speech is ended only valid after calling rtts.talk
rtts.ontalk(callback,intervel)
terminate rtts.talk
rtts.kill
Terminate the running rtts.talk
rtts.kill
list all available voices in current device options
Option | Notes |
---|---|
name | Name of the TTS instance |
lang | language of the TTS instance |
gender | Gender of the TTS instance |
age | Vocal age of the TTS instance |
id | TTS instance ID |
ver | TTS instance version |
lcid | Windows Language Code Identifier |
langid | ISO Language Code |
rtts.listVoices(options)
Options can be passed as strings separated by comas
for example if you only want to list names and age of avilable voices
rtts.listVoices('name,age')
Platform | Speak | Export | Stop | Speed | Voice | Voloume | List |
---|---|---|---|---|---|---|---|
Windows | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | 🚫 |
Linux | 🚫 | 🚫 | 🚫 | 🚫 | 🚫 | 🚫 | 🚫 |
macOS | 🚫 | 🚫 | 🚫 | 🚫 | 🚫 | 🚫 | 🚫 |