Skip to content

Commit 089a4c5

Browse files
committed
Updated index.html
1 parent e7c1d50 commit 089a4c5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2370,19 +2370,19 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
23702370
write_to_wav_file(<span class="hljs-string">'test.wav'</span>, samples_f)
23712371
</code></pre></div>
23722372

2373-
<div><h4 id="playsawavfile">Plays a WAV file:</h4><pre><code class="python language-python hljs"><span class="hljs-comment"># $ sudo apt install libasound2-dev</span>
2374-
<span class="hljs-comment"># $ pip3 install simpleaudio</span>
2373+
<div><h4 id="playsawavfile">Plays a WAV file:</h4><pre><code class="python language-python hljs"><span class="hljs-comment"># $ pip3 install simpleaudio</span>
23752374
<span class="hljs-keyword">from</span> simpleaudio <span class="hljs-keyword">import</span> play_buffer
23762375
<span class="hljs-keyword">with</span> wave.open(<span class="hljs-string">'test.wav'</span>, <span class="hljs-string">'rb'</span>) <span class="hljs-keyword">as</span> file:
23772376
p = file.getparams()
23782377
frames = file.readframes(<span class="hljs-number">-1</span>)
23792378
play_buffer(frames, p.nchannels, p.sampwidth, p.framerate)
23802379
</code></pre></div>
23812380

2382-
<div><h3 id="texttospeech">Text to Speech</h3><pre><code class="python language-python hljs"><span class="hljs-comment"># $ sudo apt install espeak ffmpeg libespeak1</span>
2383-
<span class="hljs-comment"># $ pip3 install pyttsx3</span>
2381+
<div><h3 id="texttospeech">Text to Speech</h3><pre><code class="python language-python hljs"><span class="hljs-comment"># $ pip3 install pyttsx3</span>
23842382
<span class="hljs-keyword">import</span> pyttsx3
2385-
pyttsx3.speak(&lt;str&gt;) <span class="hljs-comment"># Reads the string while blocking.</span>
2383+
engine = pyttsx3.init()
2384+
engine.say(<span class="hljs-string">'Sally sells seashells by the seashore.'</span>)
2385+
engine.runAndWait()
23862386
</code></pre></div>
23872387

23882388
<div><h2 id="synthesizer"><a href="#synthesizer" name="synthesizer">#</a>Synthesizer</h2><div><h4 id="playspopcornbygershonkingsley">Plays Popcorn by Gershon Kingsley:</h4><pre><code class="python language-python hljs"><span class="hljs-comment"># $ pip3 install simpleaudio</span>

0 commit comments

Comments
 (0)