osx-demo.js 391 B

12345678910111213141516171819
  1. #!/usr/bin/env node
  2. const say = require('../')
  3. // no callback, fire and forget
  4. say.speak('whats up, dog?', 'Alex')
  5. // no callback, fire and forget
  6. say.speak('whats up, dog?', 'Cellos', 0.5)
  7. // output some text to the console as the callback
  8. say.speak('whats up, dog?', 'Good News', 1.0, (error) => {
  9. if (error) {
  10. console.log(error)
  11. }
  12. console.log('text to speech complete')
  13. })