From 6914378afbf4ba093af18bd2d4c0d5948b2665ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Sat, 4 Jan 2020 04:37:52 +0100 Subject: [PATCH] Audio --- README.md | 4 ++-- index.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f385741..c7a3bf0 100644 --- a/README.md +++ b/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 diff --git a/index.html b/index.html index 5cf41eb..07c621c 100644 --- a/index.html +++ b/index.html @@ -2387,11 +2387,11 @@ write_to_wav_file('test.wav', samples_f)

Plays a WAV file:

# $ 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

# $ pip3 install pyttsx3