https://docs.aws.amazon.com/polly/latest/dg/SynthesizeSpeechSamplePython.html

 

SynthesizeSpeech - Amazon Polly

SynthesizeSpeech The following Python code example uses the AWS SDK for Python (Boto) synthesize speech with shorter texts for near real-time processing. For more information, see the reference for the SynthesizeSpeech operation. This example uses a short

docs.aws.amazon.com

 

This example uses a short string of plain text. You can use SSML text for more control over the output. For more information, see Generating Speech from SSML Documents.

 
import boto3

polly_client = boto3.Session(
                aws_access_key_id=,                     
    aws_secret_access_key=,
    region_name='us-west-2').client('polly')

response = polly_client.synthesize_speech(VoiceId='Joanna',
                OutputFormat='mp3', 
                Text = 'This is a sample text to be synthesized.',
                Engine = 'neural')

file = open('speech.mp3', 'wb')
file.write(response['AudioStream'].read())
file.close()

'컴퓨터 이야기~ > 소프트웨어' 카테고리의 다른 글

odp -> jpg + txt  (0) 2023.12.09
ffmpeg 로 더빙넣기.  (0) 2023.12.08
Sendmail error log 가 쌓이는 문제  (0) 2023.12.03
CURLOPT_MUTE deprecated  (0) 2023.12.03
구글에서 피부질환검색 AI  (0) 2023.06.25
,