Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //ibm watson tts
- const TextToSpeechV1 = require('watson-developer-cloud/text-to-speech/v1');
- const textToSpeech = new TextToSpeechV1({
- username: "key",
- password: "pass"
- });
- var params = {
- voice: 'pt-BR_IsabelaVoice',
- accept: 'audio/wav'
- };
- //ibm watson tts
- params.text = result;
- const transcript = textToSpeech.synthesize(params);
- transcript.on('response', (response) => {
- response.headers['content-disposition'] = 'attachment; filename=transcript.wav';
- });
- transcript.on('error', next);
- transcript.pipe(res);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement