Menu
Docs
Feedback
Login
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
TextToSpeechSynthesis
Convert text into speech synchronously.
Input
Text
Voice
Audio
Result
Audio content
Integrate
1.
Choose a provider
Mock implementation
google-apis-text-to-speech
ibm-cloud-text-to-speech
Request a missing 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
Copy
Copied!
Copy
Copied!
Structure details
Input (object)
text
required
The text input to be synthesized.
string
voice
required
Voice selection options.
object
languageCode
required
The language (and potentially also the region) of the voice expressed as a BCP-47 language tag, e.g. 'en-US'.
string
name
optional
The name of the voice.
string
audio
required
Audio format options.
object
encoding
required
The format of the audio byte stream.
enum
mp3
linear_pcm
sampleRateHertz
optional
The synthesis sample rate in hertz for the audio. Selected sample rate has to be supported by selected audio encoding format.
number
Example
Copy
Copied!
Result (object)
audioContent
required
Synthesised audio data bytes encoded as specified in the audio options input.
Example
Copy
Copied!
Implementation details
Provider
mock
Use case
TextToSpeechSynthesis
Author
@superface
Source
View source
Verified