Skip to content

Commit 6914378

Browse files
committed
Audio
1 parent c908ce4 commit 6914378

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2807,11 +2807,11 @@ write_to_wav_file('test.wav', samples_f)
28072807
#### Plays a WAV file:
28082808
```python
28092809
# $ pip3 install simpleaudio
2810-
import simpleaudio
2810+
from simpleaudio import play_buffer
28112811
with wave.open('test.wav', 'rb') as file:
28122812
p = file.getparams()
28132813
frames = file.readframes(p.nframes)
2814-
simpleaudio.play_buffer(frames, p.nchannels, p.sampwidth, p.framerate)
2814+
play_buffer(frames, p.nchannels, p.sampwidth, p.framerate)
28152815
```
28162816

28172817
### Text to Speech

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2387,11 +2387,11 @@
23872387
</code></pre></div>
23882388

23892389
<div><h4 id="playsawavfile">Plays a WAV file:</h4><pre><code class="python language-python hljs"><span class="hljs-comment"># $ pip3 install simpleaudio</span>
2390-
<span class="hljs-keyword">import</span> simpleaudio
2390+
<span class="hljs-keyword">from</span> simpleaudio <span class="hljs-keyword">import</span> play_buffer
23912391
<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:
23922392
p = file.getparams()
23932393
frames = file.readframes(p.nframes)
2394-
simpleaudio.play_buffer(frames, p.nchannels, p.sampwidth, p.framerate)
2394+
play_buffer(frames, p.nchannels, p.sampwidth, p.framerate)
23952395
</code></pre></div>
23962396

23972397
<div><h3 id="texttospeech">Text to Speech</h3><pre><code class="python language-python hljs"><span class="hljs-comment"># $ pip3 install pyttsx3</span>

0 commit comments

Comments
 (0)