<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.pedromussato.com/index.php?action=history&amp;feed=atom&amp;title=Python_TTS_%28Text_To_Speech%29_with_AWS_Polly</id>
	<title>Python TTS (Text To Speech) with AWS Polly - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.pedromussato.com/index.php?action=history&amp;feed=atom&amp;title=Python_TTS_%28Text_To_Speech%29_with_AWS_Polly"/>
	<link rel="alternate" type="text/html" href="https://wiki.pedromussato.com/index.php?title=Python_TTS_(Text_To_Speech)_with_AWS_Polly&amp;action=history"/>
	<updated>2026-04-10T17:10:43Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.3</generator>
	<entry>
		<id>https://wiki.pedromussato.com/index.php?title=Python_TTS_(Text_To_Speech)_with_AWS_Polly&amp;diff=212&amp;oldid=prev</id>
		<title>413vhcu1lq0463ob at 20:44, 1 January 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.pedromussato.com/index.php?title=Python_TTS_(Text_To_Speech)_with_AWS_Polly&amp;diff=212&amp;oldid=prev"/>
		<updated>2025-01-01T20:44:14Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 20:44, 1 January 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l15&quot;&gt;Line 15:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 15:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;              SampleRate=&amp;#039;22050&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;              SampleRate=&amp;#039;22050&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;          )&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;          )&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;          # Get the audio stream from the response&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;          # Get the audio stream from the response&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;          audio_stream = response.get(&amp;#039;AudioStream&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;          audio_stream = response.get(&amp;#039;AudioStream&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>413vhcu1lq0463ob</name></author>
	</entry>
	<entry>
		<id>https://wiki.pedromussato.com/index.php?title=Python_TTS_(Text_To_Speech)_with_AWS_Polly&amp;diff=211&amp;oldid=prev</id>
		<title>413vhcu1lq0463ob: Created page with &quot; # importing libs  import boto3  import logging    # Initialize the Polly client  polly_client = boto3.client(&#039;polly&#039;)    def awsPollyTTS(input_text, output_file_name=&quot;output.mp3&quot;, voice_id=&#039;Joanna&#039;, output_format=&#039;mp3&#039;):      try:          # Request speech synthesis from AWS Polly          response = polly_client.synthesize_speech(              Text=text,              VoiceId=voice_id,              OutputFormat=output_format,              SampleRate=&#039;22050&#039;          )...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.pedromussato.com/index.php?title=Python_TTS_(Text_To_Speech)_with_AWS_Polly&amp;diff=211&amp;oldid=prev"/>
		<updated>2025-01-01T20:43:33Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot; # importing libs  import boto3  import logging    # Initialize the Polly client  polly_client = boto3.client(&amp;#039;polly&amp;#039;)    def awsPollyTTS(input_text, output_file_name=&amp;quot;output.mp3&amp;quot;, voice_id=&amp;#039;Joanna&amp;#039;, output_format=&amp;#039;mp3&amp;#039;):      try:          # Request speech synthesis from AWS Polly          response = polly_client.synthesize_speech(              Text=text,              VoiceId=voice_id,              OutputFormat=output_format,              SampleRate=&amp;#039;22050&amp;#039;          )...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt; # importing libs&lt;br /&gt;
 import boto3&lt;br /&gt;
 import logging&lt;br /&gt;
 &lt;br /&gt;
 # Initialize the Polly client&lt;br /&gt;
 polly_client = boto3.client(&amp;#039;polly&amp;#039;)&lt;br /&gt;
 &lt;br /&gt;
 def awsPollyTTS(input_text, output_file_name=&amp;quot;output.mp3&amp;quot;, voice_id=&amp;#039;Joanna&amp;#039;, output_format=&amp;#039;mp3&amp;#039;):&lt;br /&gt;
     try:&lt;br /&gt;
         # Request speech synthesis from AWS Polly&lt;br /&gt;
         response = polly_client.synthesize_speech(&lt;br /&gt;
             Text=text,&lt;br /&gt;
             VoiceId=voice_id,&lt;br /&gt;
             OutputFormat=output_format,&lt;br /&gt;
             SampleRate=&amp;#039;22050&amp;#039;&lt;br /&gt;
         )&lt;br /&gt;
&lt;br /&gt;
         # Get the audio stream from the response&lt;br /&gt;
         audio_stream = response.get(&amp;#039;AudioStream&amp;#039;)&lt;br /&gt;
 &lt;br /&gt;
         # Write the audio stream to a file (in this case, an MP3 file)&lt;br /&gt;
         with open(output_file_name, &amp;#039;wb&amp;#039;) as audio_file:&lt;br /&gt;
             audio_file.write(audio_stream.read())&lt;br /&gt;
         print(f&amp;quot;Speech synthesis complete. The audio is saved as &amp;#039;{output_file_name}&amp;#039;.&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
     except Exception as e:&lt;br /&gt;
         logging.error(f&amp;quot;Error synthesizing speech: {e}&amp;quot;)&lt;br /&gt;
         print(f&amp;quot;Error synthesizing speech: {e}&amp;quot;)&lt;/div&gt;</summary>
		<author><name>413vhcu1lq0463ob</name></author>
	</entry>
</feed>