Skip to content

Commit c45368c

Browse files
committed
audio fix
1 parent 05a18a2 commit c45368c

File tree

5 files changed

+8
-1
lines changed

5 files changed

+8
-1
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,12 @@
3636
photos/*.jpg
3737
photos/*.mp4
3838

39+
# Sounds recorded
40+
sounds/*.wav
41+
3942
# Logs
4043
logs/*.log
44+
logs/*.log.*
4145

4246
# Tutorial
4347
static/blockly-tutorial

audio.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ def record(self, elapse):
9797
try:
9898
snd_data = array('h', self.stream_in.read(CHUNK_SIZE))
9999
r.extend(snd_data)
100-
logging.info("read: " + str(len(snd_data)) + " elapse: " + str(time.time() - t))
101100
except IOError as ex:
102101
if ex[1] != pyaudio.paInputOverflowed:
103102
raise
@@ -126,6 +125,9 @@ def record_to_file(self, filename, elapse):
126125
wf.close()
127126

128127
def play(self, filename):
128+
os.system ('omxplayer sounds/' + filename)
129+
130+
"""
129131
# open the file for reading.
130132
wf = wave.open(SOUNDDIR + filename, 'rb')
131133
@@ -148,6 +150,7 @@ def play(self, filename):
148150
149151
# cleanup stuff.
150152
stream.close()
153+
"""
151154

152155
def hear(self, level, elapse=1.0):
153156
sig_hear = False

sounds/test01.wav

-392 KB
Binary file not shown.

sounds/test02.wav

-8.04 KB
Binary file not shown.

sounds/test03.wav

-336 KB
Binary file not shown.

0 commit comments

Comments
 (0)