Type Alias TextToSpeechVoiceOptions

TextToSpeechVoiceOptions: {
    encoding?: LiteralUnion<TextToSpeechEncoding, string>;
    extend_biometric_consent?: boolean;
    language?: LiteralUnion<TextToSpeechLanguage, string>;
    model_id?: string;
    sample_rate?: TextToSpeechSampleRate;
    voice_id?: string;
}

Options shared by an HTTP request and a session: the voice and the audio.

Type declaration

  • Optionalencoding?: LiteralUnion<TextToSpeechEncoding, string>

    Output codec. Defaults to pcm_s16le. A session streams PCM or G.711 only.

  • Optionalextend_biometric_consent?: boolean

    true renews the biometric consent of the cloned voice in voice_id; a cloned voice expires 60 days after its consent was last given. Needs voice_id (422 invalid_parameter without it). Refused with not_owner (422, param: "extend_biometric_consent") on a voice the account does not own, and with biometric_terms_not_accepted (403, not retryable) until the account accepts the biometric data terms on the data controls page of the AssemblyAI dashboard. voiceExpiresAt on the response shows the new expiry after synthesize(); after stream() it is the expiry as the request started, because the headers leave with the first audio.

  • Optionallanguage?: LiteralUnion<TextToSpeechLanguage, string>

    Defaults to the voice's own language (English for aai-jane).

  • Optionalmodel_id?: string

    The model to run on, such as assemblyai-tts-1. Defaults to the region's default model.

  • Optionalsample_rate?: TextToSpeechSampleRate

    Output sample rate in Hz. Defaults to 24000.

  • Optionalvoice_id?: string

    The voice: a voice of the AssemblyAI voice library by its slug, such as aai-jane (the default), aai-alba or aai-michael; a voice's ID (a UUID); or the slug of one of the account's own cloned voices. The dashboard shows the value that names each voice.