import boto3
import contextlib
polly = boto3.client('polly')
text = 'スピーチマークを出力してみます。'
result = polly.synthesize_speech(Text=text, OutputFormat='json', VoiceId=
    'Mizuki', SpeechMarkTypes=['sentence', 'word', 'viseme'])
path = 'polly_mark.txt'
with contextlib.closing(result['AudioStream']) as stream:
    with open(path, 'wb') as file:
        file.write(stream.read())

17853fff7a02644f28e35b47b460a2a88ed4c1b9
<mask token>

<mask token>
with contextlib.closing(result['AudioStream']) as stream:
    with open(path, 'wb') as file:
        file.write(stream.read())

<mask token>
polly = boto3.client('polly')
text = 'スピーチマークを出力してみます。'
result = polly.synthesize_speech(Text=text, OutputFormat='json', VoiceId=
    'Mizuki', SpeechMarkTypes=['sentence', 'word', 'viseme'])
path = 'polly_mark.txt'
with contextlib.closing(result['AudioStream']) as stream:
    with open(path, 'wb') as file:
        file.write(stream.read())

import boto3
import contextlib
polly = boto3.client('polly')
text = 'スピーチマークを出力してみます。'
result = polly.synthesize_speech(Text=text, OutputFormat='json', VoiceId=
    'Mizuki', SpeechMarkTypes=['sentence', 'word', 'viseme'])
path = 'polly_mark.txt'
with contextlib.closing(result['AudioStream']) as stream:
    with open(path, 'wb') as file:
        file.write(stream.read())
