Amazon Polly Integration for Speech Synthesis. Amazon Polly is an AWS TTS service with native integration into the Amazon ecosystem: S3, Lambda, Cloud
Front. Supports Neural TTS (NTTS) and classic voices. For Russian: Maxim (male) and Tatyana (female) voices. Neural versions are not available for ru-RU. ### Synthesis via boto3```python import boto3
polly = boto3.client('polly', region_name='us-east-1')
def synthesize_speech(text: str) -> bytes: response = polly.synthesize_speech( Text=text, OutputFormat='mp3', # mp3 | ogg_vorbis | pcm | json VoiceId='Tatyana', # Maxim | Tatyana для ru-RU LanguageCode='ru-RU', Engine='standard', # standard | neural (не для ru-RU) SampleRate='22050', # 8000 | 16000 | 22050 TextType='text', # text | ssml ) return response['AudioStream'].read()
SSML синтез
ssml_text = """
### Presigned URL for direct access to S3python
Для длинных текстов — async task в S3
response = polly.start_speech_synthesis_task( Text=long_text, OutputFormat='mp3', VoiceId='Tatyana', OutputS3BucketName='my-tts-bucket', OutputS3KeyPrefix='audio/' ) task_id = response['SynthesisTask']['TaskId']







