You are viewing a section of Superface that will be deprecated in Q4 2023. Until then, you can continue to use it as you have before but we recommend that you migrate to our latest version soon. For more details visit superface.ai/docs/migrate.

Text to speech synthesis

speech/synthesis@1.0.1
2 providers

Text to speech synthesis

Convert text into speech synchronously.

Input
Text
Voice
Audio
Result
Audio content

1.Choose a provider

2.Use TextToSpeechSynthesis with mock in your code

Below instructions are for our Node.js SDK. Use OneService for other languages.
npm i @superfaceai/one-sdk

Structure details

Input (object)

text
The text input to be synthesized.
voice
Voice selection options.
languageCode
The language (and potentially also the region) of the voice expressed as a BCP-47 language tag, e.g. 'en-US'.
name
The name of the voice.
audio
Audio format options.
encoding
The format of the audio byte stream.
sampleRateHertz
The synthesis sample rate in hertz for the audio. Selected sample rate has to be supported by selected audio encoding format.

Example

Result (object)

audioContent
Synthesised audio data bytes encoded as specified in the audio options input.

Example

Implementation details

Provider
mock
Use case
TextToSpeechSynthesis
Author
@superface
Source
Verified