Skip to content

Instantly share code, notes, and snippets.

@Resseguie
Created October 21, 2014 01:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Resseguie/1c30f525aaad22e4d584 to your computer and use it in GitHub Desktop.
Save Resseguie/1c30f525aaad22e4d584 to your computer and use it in GitHub Desktop.
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