Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var TextToSpeechV1 = require('watson-developer-cloud/text-to-speech/v1');
- var fs = require('fs');
- var text_to_speech = new TextToSpeechV1 ({
- username: '{username}',
- password: '{password}'
- });
- var params = {
- text: 'Hello world',
- voice: 'en-US_AllisonVoice',
- accept: 'audio/wav'
- };
- // Pipe the synthesized text to a file.
- text_to_speech.synthesize(params).on('error', function(error) {
- console.log('Error:', error);
- }).pipe(fs.createWriteStream('hello_world.wav'));
Add Comment
Please, Sign In to add comment