Skip to content
tlhunter edited this page Sep 25, 2014 · 3 revisions

Just some scribbled notes for a new API proposal. Nothing is final.

Voice Groups

Platform-independent voice fallback groups

  • Male
  • Female
  • Robot

Engines

Probed in this order, can be forced during instantiation

  • say
  • espeak
  • festival
  • api

Sample Code

var Say = require('say');

console.log(Say.voices()); // ['Samantha', 'Alex', ...];
console.log(Say.engine()); // 'say' || 'espeak' || 'festival' || 'api'

var robot = new Say({
  voice: Say.Voice.Robot
});

var girl = new Say({
  voice: ["Samantha", "-ven+m3"],
  speed: 1.5
});

var adhoc = new Say();

robot.say("I'm sorry, Dave. I'm afraid I can't do that.", function(err) {
  girl.say("What are you talking about, HAL?");
});

adhoc.voice("Cellos").speed(0.75).say("Dun Dun Dunnnnnnnn");

setTimeout(function() {
  adhoc.stop();
}, 300);

adhoc
  .voice("Bells")
  .export("Fin", Say.Export.WAV, "export.wav", function(err, path) {
  console.log("Done.");
});

var online = new Say({
  engine: 'api'
});
Clone this wiki locally