Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Iterates over all say.js voices
#!/usr/bin/env node
'use strict'
var say = require('say'),
toSay = process.argv[2] || "Hello World",
voices = [
"Agnes",
"Kathy",
"Princess",
"Vicki",
"Victoria",
"Albert",
"Alex",
"Bruce",
"Fred",
"Junior",
"Ralph",
"Bad News",
"Bahh",
"Bells",
"Boing",
"Bubbles",
"Cellos",
"Deranged",
"Good News",
"Hysterical",
"Pipe Organ",
"Trinoids",
"Whisper",
"Zarvox"
];
sayIt(0);
function sayIt(voice) {
console.log(voices[voice]);
say.speak(voices[voice], toSay, function () {
voice++;
if(voice >= voices.length) {
process.exit(0);
}
sayIt(voice);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.