Skip to content

Instantly share code, notes, and snippets.

@zlargon
Last active June 22, 2016 04:08
Show Gist options
  • Save zlargon/4d5def142e6521184fd9bfa57c40d316 to your computer and use it in GitHub Desktop.
Save zlargon/4d5def142e6521184fd9bfa57c40d316 to your computer and use it in GitHub Desktop.
var voc = require('voc-cli');
/* voc
*
* @param {String} word
* @param {String} directory the location for download
* @param {String!} service
* @return Promise(audioPath: String)
*/
var word = 'Hello World';
var path = '.'; // current directory
var service = 'google'; // Dictionary => 'webster', 'collins', 'yahoo'
// Text-To-Speech => 'ispeech', 'voicerss', 'google'
voc(word, path, service)
.then(function (audioPath) {
console.log('Download to ' + audioPath);
})
.catch(function (err) {
console.log(err);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment