def submit_item_to_polly()

in amazon_polly_async_batch/itemprocessor.py [0:0]


def submit_item_to_polly(work_item):
    """
    Given a work item in a dict, posts it as an asynchronous synthesis request to Polly.

    :param work_item: a dictionary with details on the text to synthesize
    :return: the json document returned from Polly
    """
    response = polly.start_speech_synthesis_task(
        Engine=work_item['engine'],
        LanguageCode=work_item['language-code'],
        OutputFormat=work_item['output-format'],
        OutputS3BucketName=WORK_BUCKET,
        OutputS3KeyPrefix=work_item['output-s3-key-prefix'],
        SnsTopicArn=RESPONSE_TOPIC_ARN,
        Text=work_item['text'],
        TextType=work_item['text-type'],
        VoiceId=work_item['voice-id']
    )
    return response['SynthesisTask']