• Stars
    star
    1,476
  • Rank 31,845 (Top 0.7 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 14 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

TTS (text to speech) for node.js. send text from node.js to your speakers.

Installing say.js

npm install say

Usage

// automatically pick platform
const say = require('say')

// or, override the platform
const Say = require('say').Say
const say = new Say('darwin' || 'win32' || 'linux')

// Use default system voice and speed
say.speak('Hello!')

// Stop the text currently being spoken
say.stop()

// More complex example (with an OS X voice) and slow speed
say.speak("What's up, dog?", 'Alex', 0.5)

// Fire a callback once the text has completed being spoken
say.speak("What's up, dog?", 'Good News', 1.0, (err) => {
  if (err) {
    return console.error(err)
  }

  console.log('Text has been spoken.')
});

// Export spoken audio to a WAV file
say.export("I'm sorry, Dave.", 'Cellos', 0.75, 'hal.wav', (err) => {
  if (err) {
    return console.error(err)
  }

  console.log('Text has been saved to hal.wav.')
})

Methods

Speak:

  • Speed: 1 = 100%, 0.5 = 50%, 2 = 200%, etc
say.speak(text, voice || null, speed || null, callback || null)

Export Audio:

  • MacOS / Windows Only
  • Speed: 1 = 100%, 0.5 = 50%, 2 = 200%, etc
say.export(text, voice || null, speed || null, filename, callback || null)

Stop Speaking:

say.stop(callback || null)

Get List of Installed Voice(s):

say.getInstalledVoices(callback)

Feature Matrix

Unfortunately every feature isn't supported on every platform. PR's welcome!

Platform Speak Export Stop Speed Voice List
macOS 🚫
Linux 🚫 🚫
Windows

macOS Notes

Voices in macOS are associated with different localities. To a list of voices and their localities run the following command:

say -v "?"

As an example, the default voice is Alex and the voice used by Siri is Samantha.

Windows Notes

None.

Linux Notes

Linux support requires Festival. As far as I can tell there is no sane way to get a list of available voices. The only voice that seems to work is voice_kal_diphone, which seems to be the default anyway.

The .export() method is not available.

Try the following command to install Festival with a default voice:

sudo apt-get install festival festvox-kallpc16k

Requirements

  • Mac OS X (comes with say)
  • Linux with Festival installed
  • Windows (comes with SAPI.SpVoice)
    • Needs to have Powershell installed and available in $PATH (see issue #75)

More Repositories

1

colors.js

get colors in your node.js console
JavaScript
5,152
star
2

faker.js

What really happened with Aaron Swartz?
1,522
star
3

pdf.js

Project Deprecated
JavaScript
399
star
4

node_mailer

## Project deprecated, see README
JavaScript
388
star
5

translate.js

translate text from one language to another on node.js and the browser. 30+ languages supported, simple as cake.
JavaScript
309
star
6

asciimo

asciimo - create awesome ascii art with javascript! works in the browser or node.js
JavaScript
281
star
7

webservice.js

## Project deprecated, Use flatiron/restful instead
JavaScript
253
star
8

JSONloops

JSONloops is a real-time, multiuser audio sequencer for node.js and the browser.
JavaScript
184
star
9

bpipe

Browser <==> Unix Pipes
JavaScript
159
star
10

play.js

play sound files from node.js to your speakers, simple as cake and kid approved!
JavaScript
159
star
11

buddypond

Cloud OS and Instant Messenger
JavaScript
148
star
12

natman

Forwards external public ports to internal ports without router access.
JavaScript
138
star
13

cron-editor

Visual Cron Editor - Edit and Create Cron Jobs With Ease
JavaScript
138
star
14

HTML

HTML is The BEST JavaScript templating language EVER
JavaScript
99
star
15

session.js

super simple session middleware for node.js, even has optional "magic" sessions which monkey patch the httpServer with one line!
JavaScript
95
star
16

JSLINQ

Clean and simple port of Microsoft's LINQ to node.js (and the browser)
JavaScript
92
star
17

zztmmo

a zzt based massive multiplayer online game built in node.js and jQuery
JavaScript
68
star
18

The-Git-Rap

WORLD PREMIER EXCLUSIVE GIT RAP BROUGHT TO YOU BY GITHUB
64
star
19

node_hash

a super simple hashing library for node.js
JavaScript
58
star
20

roles.js

a super simple node.js JSON based roles management system
JavaScript
58
star
21

zalgo.js

ĭ̱͓̝̭̱͓̃̅͊ͬͫ̏̅ ̣͙̥̥̺͎̱̻̗̘͖́͆̎ͭ͛̊̔̽̂ͭ̽͊ͅa͎̬̣̺͉̼̬̭͚̝͖͕͇̠̥̬͍̥̪̬̪͓͇̬͓̲̹͈̼͚̥̜̙̩̠̤̖̖̫͔̭͍̘̰̳̥͖͚̱͙̻ͯ̓͗̈̌̿̾̈̐̓͗͑̃̔̿̄̚m͙͍͔̙̪͓̩͚̣͙̘̟̞͙͍̺͕̜̻̯͇͉͇̠̙̬͉̖̞̫͇͍̹̖̝̣ͫ͑̈ͥ̀̑͊͆̿ ̬̰̮͉̭̬͙̫̙͖̪̮͎͎͕͉̠̜̦͍̹̦̥̳̙̬̺̲͙͈̹̹̠̘͔̙ͨ̇͊̉͂͆ͬͯ̄̃ͪͅz͓͇̱̝̭̜̫̞͚͉̭̫̞͇̮̟̫̗̼̟͐ͦ͗̈̀͌͒̽̆ͧͭ̈͂̾̇̃̂ͅa̹̜̭͔͇̬͍̟̤͈̙̯͍͕͈͇̱̞͖̼̥̺͉̍̑̒̎l͙̙̼̰̩̟̗̙̝̜̙̺̖͍̜̞̤̞͔͖̞̘̣͍̖̰̙͔̖̳̼͐̓̾̇̑ͤ͆̈̎̔̇̃̐͒g͔̦͖̞̯͙̠̭̫̜͈̺̮̠̜̻̱̥̙ͦͧ̉͆̊̎̐ͅo͍̥̹̮͔̣̮̜̱̫̼͚̘̮̝̰̣̼͕͉͕͖̼̫͓̠̣͖̼̦͍͍̟̗̤̖̤̞̞͇̠̟̥̻͎̩̠̭̲̞͇͙̦̣̬͉̱̳͙̫̫͈̻̊̓ͫ̈ͅͅ,̼̦͓̤̘̦͖͈̜̭̩̯̹͈̭̜̙̞̿͊ͩ̄̐ͨ͐̈̎̒̉̆̍ͪ̀̿̍̌̚ ̞̳͉̮̯̱͉̜̰̜͔͈͓̹̻̭͔̖̟͓̭̜͎̰̹̪̭̖͇̟̗͕̠̞̳̤̯͕̠̳̙̘͛ͫ̅̓̿ͥ̓d͎͖̲̝̲̩̹̲̬̪̖̦̯͖̩̤̫͎̠̖͚̘̋͂̉̑̍͒̎ͅe̟͔͍̺͔̖͕̺̰̯͎̞̥̠͙̮͚̪̝͇̱̺̗̻̫̝͚͍͉̪͚̫͚͓͓̩̘͖͎̣̞̹͍ͯ̋̾ͪͮ́s̬͎͍̻͍̹̘̣͕̰͍͔̱̯̜̰̹̥̐̇̆͊ͯ̈ͮ̇̍̎̆ͥ̆̌̍̋̈̽̍ͅt͖̩̺̫̘̰̬̝̙̰̱̦̹͓̦͍̩͖̤̩͉̭̳̲̬̘̮̥̠̤̺͇͈̩̺̞̗̰̘͚̯̦̺̤̥̞̞̻̯̳͙͕̹̜̩͔̫̺̖͍̺́͋ͫ̿ͨ̿ͩ̀͊͌͐͛̂̊̄ͅͅr͎̺͕̟̦̩̙̯͓͈̪̜̤͎͔̯͕̫͉͇͓͔̘̪̝̤̩̣̺̮͉̘̠̠̣̟̮͚̠̘̹͓̥͉͖͓̞͍͖̼̯̤̦̟͔̦̖͔͙̝̫͓͉̖̳̞̅͐ͩ̔̄ͯ͌́̋̒ͧ̽͆̀o̮̳̞̭̪̣͙̰̭̱̺̬̻͙̰̰̣̪̩̱̫̱̞̣͇̭̫̺̙̹͓̭͕̮͕̞̦̗̾͒̉̍̌ͯý͖̖̗̲̥͉̹͚̝̫̟͕̭͖͉͍͇͎͓̣̭̗̤̩͖̼̪͙̣̖̣͓̮̯̤̙͇͖̠̮̦̭̙̝͖̦̞̠̩̺̼̱̱̦̤̥̮̲̻̬̱̋ͪ̓́̒͆̓ͥ͋̓̉̎ͣ̇̍̚ͅe̬͙̱̬͕͚̞̯͎̻̟̙̪̙̝̥̣̫̲̮̖̪ͬͣͭ̉̾ͪ̐ͫ͒̈ͅr̭͓̥̯̘̗̮͍͓̰̦̬͈̖̖̟̹̥̼͙͔̭̪̩͉̠̠̬̜̺̞̘̳̭͔̥̗̱̠͕̠͉̳̻̫̖̘̬̺͍̠͔͙̻̮͉̩̲͈̳̞̊͑͒̿̃̊̉͌̂ͧ̃ͨͬ̅̿ͅͅͅͅͅ ̬̺͚̤͎͓̦̻̻̠͙͎̬̣͖̹͕̫̭̝̗̞͖̣̥̯͉͚̮̗̩̭͛ͭͭ̽ͥ͐͐͆͌ͅo̹̦͈̭̰̬̲̣͓̩͓̖̟͓̼͓̬̾́ͪͬ́ͯ̉̃̒ͫ̌̔ͣ̊ͤ̀ͅf͙̱͚͙̰̳̞̹̠̭̲̮̰͍̼̦̯̳̮͚̝͍̙̻͒ͥ́̐̄͑ͣ ̞̹̮̹̹̲̻̝ͫͫ̓̒̚ẉ̹̘̲̗̟̯͖̲͈͕̮͍̯̟͚̩͖͚̖̭̗͛̔̏̇͆̈̃ͤ̎̎͊ͅe̮͈͔̱͇̩̗͖͕͙̯͎̮̬͈̤͕̣̺̼̰͉̗̙̹̦̤̋̐͐͊̔͋̇b̳̝̱͖̥̘͙͈̻̯̰͕̪̜̻͓̩̙̻̭̗̝̲̘̼̰̘̗̳̪͓̠̗͈͕̰͚̣̱̖̼̺̬̯̻̞͙͈̜̖̪͓̣͎̮͑ͤ̈ͯͩͧͯ̍̍ͯ̉͗̎̎͌̿̌͌s̲͉̦̠̣̺̬͇͙̥̪̖̼͉͉ͣ̃̌͋̀ͮ͗̊̉͂͑̿̑͂̄i̱̪̣̪̭̖̙͔̥͚̳͙̻̪̺̲̞͖̻̠͓̻̹̖͔͔̲̣̤̘̪̩̬͇͉͎̰͕̫̭͓̿͐́̈ͦ̊ͮ̉͌ͨ̏ͨͩ̿̆t͖͙͉͎͓̩̻͖͍͚͓͇̞̲̤͚̳͓̪̟̙̗͕͔̦̫̗͍͔̦͇̪͕͉͙̦̬̐͌͊ͮͅe̝̫̤̠͎͇̟̟͔͓̻̤̼͚̥̤̗̘̰͚̘̪͉̻̥͓̟̘̘̹̼̲̲͚̝̯̱͍͍̜͈̪͕̟̝͕͖̝͕̰̣͙̺͎̜͇̜͕͇̗̘ͥͮͥ̌̉̾ͯ͗ͅͅͅͅs͔̯̗̩͔̪̼̲̫̼͙̼̰̟̥͙̠͕̳̣̯͔̮̥̝̠̤̝͍̤͉͚̖̯͖̰̱̹̜̞͈̭̞͖̓͊́̾̍̑͐ͩͅͅ
JavaScript
55
star
22

javascript-fu

a javascript martial arts library for node.js and the browser. destroy the bad parts with ninja-like precision
JavaScript
50
star
23

ANSIdom

a DOM implementation in ANSI escape codes, render HTML to your terminal
JavaScript
37
star
24

node-raps

a community based rap project to teach and promote node.js
36
star
25

xp

agile programming tools in Coffeescript
CoffeeScript
32
star
26

ohh

share content, have fun, make friends
JavaScript
29
star
27

wizard

experimental configuration wizard that transforms json and json-schemas into user-experiences
JavaScript
25
star
28

ayyo-wars

An open and hackable 2D space battle game
JavaScript
24
star
29

hellonode

( used for testing ) a sample node.js application with a well-formed package.json that has contains required fields for nodejitsu deployment
JavaScript
19
star
30

node-kiwf

kill it with fire, in-process node.js process kill-switch, forces node processes to crash based on certain restrictions like memory usage or uptime
JavaScript
18
star
31

machine.js

turn css selectors into state machines
JavaScript
17
star
32

station

a real-time web i/o reporting application built with hook.io
JavaScript
17
star
33

css_to_json

converts .css files into nested json structures ( json-stylesheets )
JavaScript
16
star
34

the-monolith-versus-the-microservice

a tale of two applications. one built as a monolith. the same built with microservices
JavaScript
15
star
35

vinyl-http

push and receive streams of vinyl over http
JavaScript
11
star
36

prototype-hooks

add before and after hooks to any JavaScript prototype chain
JavaScript
10
star
37

mybuddy

JavaScript
10
star
38

data-behaviors

open-source uber unobtrusive behavior (widget) library built with jQuery. uses HTML5's data-attributes, but still works in IE6
JavaScript
10
star
39

node-backbone-request

A syncing engine for server-side backbone.js built on the request library
JavaScript
10
star
40

node-stats

various tools for crunching node.js community data. mostly incomplete.
JavaScript
7
star
41

vinyl-diff

Perform diffs of vinyl file streams
JavaScript
5
star
42

tracker.js

JavaScript
5
star
43

analog-tv-simulation

simulated analog tv presentation for speakeasy js oct 16 2020
JavaScript
5
star
44

Internet_Money

5
star
45

ePlaying-cards

Software and hardware project for e-paper based playing card deck.
Python
4
star
46

senpai

a digital protege for maintaining your open source empire
JavaScript
4
star
47

microtail

HTTP microservice for easily and safely mapping Unix `tail` commands on your server to authenticated public URLs.
JavaScript
3
star
48

badproject

( used for testing ) an example of a malformed node.js package.json
JavaScript
3
star
49

resourceful-coder

Converts Resourceful resources back into the JavaScript code which created them. Not something you probably need.
JavaScript
3
star
50

command-line-signups

JavaScript
3
star
51

resource-builder

UNRELEASED - simple UI for building Resourceful resources
JavaScript
3
star
52

SupremeJSONCompressor

The Supreme JSON Compressor™ is the world's best JSON Compressor / Decompressor.
JavaScript
3
star
53

buddypond-assets

2
star
54

marak.github.io

JavaScript
2
star
55

badjitsu

( used for testing ) an example of a node.js package.json which is missing required fields for nodejitsu deployment.
JavaScript
2
star
56

marak.com-legacy

website for marak.com
JavaScript
2
star