Skip to content

get_speech_synthesis_task

get_speech_synthesis_task(
    task_id: TaskId, *, config_overrides: Optional[PollyClientConfig] = None
) -> GetSpeechSynthesisTaskOutput

Retrieves a specific SpeechSynthesisTask object based on its TaskID. This object contains information about the given speech synthesis task, including the status of the task, and a link to the S3 bucket containing the output of the task.

Parameters:

  • task_id (TaskId) –

    The Amazon Polly generated identifier for a speech synthesis task.

Raises:

Source code in docs_src/capo_polly/_services/polly.py
def get_speech_synthesis_task(
    self,
    task_id: "capo_polly.types.task_id.TaskId",
    *,
    config_overrides: Optional[PollyClientConfig] = None,
) -> (
    "capo_polly.types.get_speech_synthesis_task_output.GetSpeechSynthesisTaskOutput"
):
    """<p>Retrieves a specific SpeechSynthesisTask object based on its TaskID. This object contains information about the given speech synthesis task, including the status of the task, and a link to the S3 bucket containing the output of the task.</p>

    Args:
        task_id: <p>The Amazon Polly generated identifier for a speech synthesis task.</p>

    Raises:
        capo_polly.errors.invalid_task_id_exception.InvalidTaskIdException: <p>The provided Task ID is not valid. Please provide a valid Task ID and try again.</p>
        capo_polly.errors.service_failure_exception.ServiceFailureException: <p>An unknown condition has caused a service failure.</p>
        capo_polly.errors.synthesis_task_not_found_exception.SynthesisTaskNotFoundException: <p>The Speech Synthesis task with requested Task ID cannot be found.</p>
        capo_polly.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_polly.types.get_speech_synthesis_task_input.GetSpeechSynthesisTaskInput]",
    ) -> OperationResponse[
        "capo_polly.types.get_speech_synthesis_task_output.GetSpeechSynthesisTaskOutput"
    ]:
        import capo_polly._operations.parrot_v1.get_speech_synthesis_task

        output, http_response = (
            capo_polly._operations.parrot_v1.get_speech_synthesis_task.get_speech_synthesis_task(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetSpeechSynthesisTask")
    )
    input_: capo_polly.types.get_speech_synthesis_task_input.GetSpeechSynthesisTaskInput = {
        "task_id": task_id
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output