2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Amazon Polly を試す

Last updated at Posted at 2017-10-25

テキストをMP3の音声データに。

# !/usr/bin/env python                                                                                                                                                                                                                                                           
# -*- coding: utf-8 -*-                                                                                                                                                                                                                                                          

from boto3 import client

def main():
    """                                                                                                                                                                                                                                                                         
    """
    polly = client("polly")

    response = polly.synthesize_speech(Text="数字の中で、7だけが孤独なのよ。",
                                       OutputFormat="mp3",
                                       VoiceId="Mizuki")

    with open("sound.mp3", "wb") as fd:
        fd.write(response.get("AudioStream").read())


if __name__ == "__main__":
    """                                                                                                                                                                                                                                                                         
    """
    main()
2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?