Advertisement
Guest User

Untitled

a guest
Feb 11th, 2017
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. //ibm watson tts
  2. const TextToSpeechV1 = require('watson-developer-cloud/text-to-speech/v1');
  3.  
  4. const textToSpeech = new TextToSpeechV1({
  5. username: "key",
  6. password: "pass"
  7. });
  8.  
  9. var params = {
  10. voice: 'pt-BR_IsabelaVoice',
  11. accept: 'audio/wav'
  12. };
  13.  
  14. //ibm watson tts
  15.  
  16. params.text = result;
  17. const transcript = textToSpeech.synthesize(params);
  18. transcript.on('response', (response) => {
  19. response.headers['content-disposition'] = 'attachment; filename=transcript.wav';
  20. });
  21. transcript.on('error', next);
  22. transcript.pipe(res);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement