Browse Source

Audio

pull/46/head
Jure Šorn 4 years ago
parent
commit
6914378afb
2 changed files with 4 additions and 4 deletions
  1. 4
      README.md
  2. 4
      index.html

4
README.md

@ -2807,11 +2807,11 @@ write_to_wav_file('test.wav', samples_f)
#### Plays a WAV file:
```python
# $ pip3 install simpleaudio
import simpleaudio
from simpleaudio import play_buffer
with wave.open('test.wav', 'rb') as file:
p = file.getparams()
frames = file.readframes(p.nframes)
simpleaudio.play_buffer(frames, p.nchannels, p.sampwidth, p.framerate)
play_buffer(frames, p.nchannels, p.sampwidth, p.framerate)
```
### Text to Speech

4
index.html

@ -2387,11 +2387,11 @@ write_to_wav_file(<span class="hljs-string">'test.wav'</span>, samples_f)
</code></pre></div>
<div><h4 id="playsawavfile">Plays a WAV file:</h4><pre><code class="python language-python hljs"><span class="hljs-comment"># $ pip3 install simpleaudio</span>
<span class="hljs-keyword">import</span> simpleaudio
<span class="hljs-keyword">from</span> simpleaudio <span class="hljs-keyword">import</span> play_buffer
<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:
p = file.getparams()
frames = file.readframes(p.nframes)
simpleaudio.play_buffer(frames, p.nchannels, p.sampwidth, p.framerate)
play_buffer(frames, p.nchannels, p.sampwidth, p.framerate)
</code></pre></div>
<div><h3 id="texttospeech">Text to Speech</h3><pre><code class="python language-python hljs"><span class="hljs-comment"># $ pip3 install pyttsx3</span>

Loading…
Cancel
Save