[Python] How to save file as mp3 from Amazon Polly using Python

Discussão em 'Python' iniciado por Stack, Setembro 17, 2025.

  1. Stack

    Stack Membro Participativo

    I am using Amazon Polly for TTS, but I am not able to get how to save the converted speech into a .mp3 file in my computer

    I have tried gTTS but i require Amazon Polly for my task.

    import boto3
    client = boto3.client('polly')
    response = client.synthesize_speech
    (Text = "Hello my name is Shubham", OuptutFormat = "mp3", VoiceId = 'Aditi')


    Now, what Should I do to play this converted speech or save it into my PC as .mp3 file?

    Continue reading...

Compartilhe esta Página