Skip to content

SynthesizeSpeechOutput

Source code in docs_src/capo_polly/types/synthesize_speech_output.py
class SynthesizeSpeechOutput(TypedDict, closed=True):
    audio_stream: "capo_polly.types.audio_stream.AudioStream"
    """<p> Stream containing the synthesized speech. </p>"""
    content_type: NotRequired["capo_polly.types.content_type.ContentType"]
    """<p> Specifies the type audio stream. This should reflect the <code>OutputFormat</code> parameter in your request. </p> <ul> <li> <p> If you request <code>mp3</code> as the <code>OutputFormat</code>, the <code>ContentType</code> returned is audio/mpeg. </p> </li> <li> <p> If you request <code>ogg_vorbis</code> as the <code>OutputFormat</code>, the <code>ContentType</code> returned is audio/ogg. </p> </li> <li> <p> If you request <code>ogg_opus</code> as the <code>OutputFormat</code>, the <code>ContentType</code> returned is audio/ogg. </p> </li> <li> <p> If you request <code>pcm</code> as the <code>OutputFormat</code>, the <code>ContentType</code> returned is audio/pcm in a signed 16-bit, 1 channel (mono), little-endian format. </p> </li> <li> <p> If you request <code>mu-law</code> as the <code>OutputFormat</code>, the <code>ContentType</code> returned is audio/mulaw. </p> </li> <li> <p> If you request <code>a-law</code> as the <code>OutputFormat</code>, the <code>ContentType</code> returned is audio/alaw. </p> </li> <li> <p>If you request <code>json</code> as the <code>OutputFormat</code>, the <code>ContentType</code> returned is application/x-json-stream.</p> </li> </ul> <p> </p>"""
    request_characters: "capo_polly.types.request_characters.RequestCharacters"
    """<p>Number of characters synthesized.</p>"""

audio_stream instance-attribute

audio_stream: AudioStream

Stream containing the synthesized speech.

content_type instance-attribute

content_type: NotRequired[ContentType]

Specifies the type audio stream. This should reflect the OutputFormat parameter in your request.

  • If you request mp3 as the OutputFormat, the ContentType returned is audio/mpeg.

  • If you request ogg_vorbis as the OutputFormat, the ContentType returned is audio/ogg.

  • If you request ogg_opus as the OutputFormat, the ContentType returned is audio/ogg.

  • If you request pcm as the OutputFormat, the ContentType returned is audio/pcm in a signed 16-bit, 1 channel (mono), little-endian format.

  • If you request mu-law as the OutputFormat, the ContentType returned is audio/mulaw.

  • If you request a-law as the OutputFormat, the ContentType returned is audio/alaw.

  • If you request json as the OutputFormat, the ContentType returned is application/x-json-stream.

request_characters instance-attribute

request_characters: RequestCharacters

Number of characters synthesized.