Table of Contents

Class TextToSpeechSynthesisResponse

public class TextToSpeechSynthesisResponse
Inheritance
object
TextToSpeechSynthesisResponse

Fields

Audio

The audio data bytes encoded as specified in the request, including the header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS).

public string Audio

Field Value

string

Remarks

For LINEAR16 audio, we include the WAV header. Note: as with all bytes fields, protobuffers use a pure binary representation, whereas JSON representations use base64.

AudioMetadata

The audio metadata for Audio. Only returned when using the beta API.

public TextToSpeechSynthesizedAudioMetadata AudioMetadata

Field Value

TextToSpeechSynthesizedAudioMetadata

TimePoints

A link between a position in the original request input and a corresponding time in the output audio. It's only supported via <mark> of SSML input. Only returned when using the beta API.

public TextToSpeechSynthesisTimePoint[] TimePoints

Field Value

TextToSpeechSynthesisTimePoint[]

Methods

ToAudioClip()

Converts the base64 encoded audio to an AudioClip. Requires the the beta API.

public Awaitable<AudioClip> ToAudioClip()

Returns

Awaitable<AudioClip>

The audio converted to an AudioClip.

Exceptions

IOException

Thrown if encoding is unsupported.

ToAudioClip(TextToSpeechSynthesisAudioEncoding)

Converts the base64 encoded audio to an AudioClip.

public Awaitable<AudioClip> ToAudioClip(TextToSpeechSynthesisAudioEncoding encoding)

Parameters

encoding TextToSpeechSynthesisAudioEncoding

The encoding of the audio.

Returns

Awaitable<AudioClip>

The audio converted to an AudioClip.

Exceptions

IOException

Thrown if encoding is unsupported.