JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 11486
  • Score
    100M100P100Q123181F
  • License MIT

TTS (Text To Speech) Module for Node.js

Package Exports

  • say

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (say) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Installing say.js

npm install say

Usage - Mac OS voices

Speed is based on the average number of words to be spoken per minute.

var say = require('say');

// use default voice in System Preferences
say.speak('Hello!');

// no callback, fire and forget
say.speak('whats up, dog?', 'Alex', 20);

// output some text to the console as the callback
say.speak('whats up, dog?', 'Good News', undefined, function(error) {
  if (error) {
    return console.log(error);
  }

  console.log('text to speech complete');
});

Usage - Windows

Voice parameter is not yet available. Used whatever default system voice is set, ignoring voice parameter. Speed parameter is not yet available.

Usage - Linux

Linux support involves the use of Festival, which uses decidedly less friendly names for its voices. Voices for Festival sometimes need to be installed separately - you can check which voices are available by starting up Festival in interactive mode, typing (voice_, and pressing TAB. Then take the name of the voice you'd like to try, minus the parentheses, and pass it in to say.js.

Speed is a percent based upon the normal rate, so 50 is 50%, 120 is 120%, etc.

Try the following commad to install Festival as well as a default voice:

sudo apt-get install festival festvox-kallpc16k

Available Voices on OS X

Women

  • Agnes
  • Kathy
  • Princess
  • Vicki
  • Victoria

Men

  • Albert
  • Alex
  • Bruce
  • Fred
  • Junior
  • Ralph

Others

  • Bad News
  • Bahh
  • Bells
  • Boing
  • Bubbles
  • Cellos
  • Deranged
  • Good News
  • Hysterical
  • Pipe Organ
  • Trinoids
  • Whisper
  • Zarvox

Requirements

  • Mac OS (comes with say)
  • Linux with Festival installed
  • Windows (comes with SAPI.SpVoice)