【发布时间】:2020-05-31 14:58:26
【问题描述】:
我正在使用 python 3,当我尝试运行我的代码时,我得到一个错误:
raise NoRegionError()
botocore.exceptions.NoRegionError: You must specify a region.
我的代码:
import boto3
client = boto3.client('polly')
output = client.synthesize_speech (
Text = "Some random text I want to convert", OutputFormat = "mp3", VoiceId = 'Aditi'
)
print(output['AudioStream'])
file = open('speech.mp3', 'wb')
file.write(output['AudioStream'].read())
file.close()
【问题讨论】:
标签: python boto3 amazon-polly