Pico speaker (TTS) module for node js
PicoSpeaker is a TTS module for node. I created this module for my personal assistant project on a Raspberry Pi (raspbian). I use picoSpeaker to have my raspberry talk to me.
This module works on a linux based OS (raspbian, Ubuntu, Debian...) using alsa for audio.
This module requires pico tools and a alsa-utils to be installed.
sudo apt-get install libttspico0 libttspico-utils libttspico-data alsa-utils
You can simply add this module to your node.js project with
// sudo might be required depending on your systemnpm install --save pico-speaker
There are four public methods you can use:
- picoSpeaker.init(picoConfig); => this needs to be called to initialize clap detection. The picoConfig object is not mandatory but you can use it to overwrite the default configuration (see next section)
- picoSpeaker.speak(text) => read text and returns a promise that is resolved when the sentenced is finished
- picoSpeaker.repeat() => repeat last sentence returns a promise that is resolved when the sentenced is finished
- picoSpeaker.shutUp() => interrupt all sentences being spoken at the moment
// Require the modulevar picoSpeaker = require;// Define configurationvar picoConfig =;// Initialize with configpicoSpeaker.init;// Say hellospeaker.speak.
You can pass a configuration object at the initialisation time (picoSpeaker.init(yourConfObject)). If you don't the following config will be used.
/* DEFAULT CONFIG */var CONFIG =;
These will be added soon. Please do not hesitate to add some !
About the Author
pico-speaker is dual licensed under the MIT license and GPL. For more information click here.