Text to speech synthesis

Version: 1.0.1
speech/synthesis
superface

Turn text into natural-sounding speech.

Text to speech synthesis

Convert text into speech synchronously.

Text
Voice
Audio
Audio content

1. Install

npx @superfaceai/cli install speech/synthesis

2. Use in your code

const { SuperfaceClient } = require('@superfaceai/one-sdk');

const sdk = new SuperfaceClient();

async function run() {
  // Load the installed profile
  const profile = await sdk.getProfile('speech/synthesis');

  // Use the profile
  const result = await profile
    .getUseCase('TextToSpeechSynthesis')
    .perform({
      text: 'Hello world.',
      voice: {
        languageCode: 'en-US'
      },
      audio: {
        encoding: 'linear_pcm'
      }
    });

  return result.unwrap();
}

run();

3. Add providers