How to use the ibm-watson/text-to-speech/v1 function in ibm-watson

To help you get started, we’ve selected a few ibm-watson examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github leon-ai / leon / server / src / tts / watson-tts / synthesizer.js View on Github external
synthesizer.init = () => {
  const credentials = JSON.parse(fs.readFileSync(`${__dirname}/../../config/voice/watson-tts.json`, 'utf8'))

  try {
    if (process.env.LEON_LANG === 'fr-FR') {
      log.warning('fr-FR (male) is not yet implemented for the Watson TTS synthesizer')
    }

    client = new Tts(credentials)

    log.success('Synthesizer initialized')
  } catch (e) {
    log.error(`Watson TTS: ${e}`)
  }
}