Type Alias TextToSpeechResponseInfo

TextToSpeechResponseInfo: {
    audioDurationMs?: number;
    billedCharacters?: number;
    bitRate?: number;
    container?: string;
    contentType?: string;
    encoding?: string;
    language?: string;
    model?: string;
    region?: string;
    requestId?: string;
    sampleRate?: number;
    unknownParams?: string[];
    voiceExpiresAt?: number;
    voiceId?: string;
}

What the response headers of a 200 say about the audio.

Type declaration

  • OptionalaudioDurationMs?: number

    The audio's duration in milliseconds, on a complete response.

  • OptionalbilledCharacters?: number

    The characters the request bills. On a stream, the value as the stream started: the headers leave with the first audio, before the outcome is known, so a body cut by a server failure bills 0 instead.

  • OptionalbitRate?: number
  • Optionalcontainer?: string

    raw or wav; absent for MP3.

  • OptionalcontentType?: string

    The response's Content-Type, such as audio/pcm;rate=24000;channels=1.

  • Optionalencoding?: string

    The codec used, in canonical form (pcm_mulaw, never mulaw).

  • Optionallanguage?: string
  • Optionalmodel?: string

    The model that spoke, such as assemblyai-tts-1.

  • Optionalregion?: string

    The region that served the request, such as us-east-1.

  • OptionalrequestId?: string

    The request's id (X-Request-Id). Quote it in support requests.

  • OptionalsampleRate?: number
  • OptionalunknownParams?: string[]

    Body fields the API did not recognize and ignored (X-TTS-Unknown-Params), such as a camelCase sampleRate for sample_rate. The API lists at most 16, sorted, and shows a name it cannot echo as <invalid>. Absent when every field was known.

  • OptionalvoiceExpiresAt?: number

    For a cloned voice of the account: its expiry as a Unix time in seconds, after the request's consent renewal on synthesize(). On a stream, the value as the stream started: the headers leave with the first audio, before any renewal.

  • OptionalvoiceId?: string

    The voice that spoke: the request's voice_id, or the default voice's slug.