watson-developer-cloud / text-to-speech-nodejs

This is a deprecated Watson Text to Speech Service Demo. A link to the newly supported demo is below
https://www.ibm.com/demos/live/tts-demo/self-service/
Apache License 2.0
348 stars 273 forks source link

update this fragment for work #76

Closed johnfelipe closed 7 years ago

johnfelipe commented 7 years ago
var tts_credentials = extend({
  url: 'https://stream.watsonplatform.net/text-to-speech/api',
  version: 'v1',
  username: 'xxxxxxx',
  password: 'xxxxx',
}, bluemix.getServiceCreds('text_to_speech'));

// Create the service wrappers
var textToSpeech = watson.text_to_speech(tts_credentials);

app.get('/synthesize', function(req, res) {
  var transcript = textToSpeech.synthesize(req.query);
  transcript.on('response', function(response) {
    if (req.query.download) {
      response.headers['content-disposition'] = 'attachment; filename=transcript.ogg';
    }
  });
  transcript.on('error', function(error) {
    console.log('Synthesize error: ', error)
  });
  transcript.pipe(res);
});

I need update this fragment, because i cant hear speak Tnks

nfriedly commented 7 years ago

I don't think that's an issue with the demo. Try using an up-to-date Firefox or Chrome, or download the audio and play it with VLC.