diff options
Diffstat (limited to 'client/speaker.py')
| -rw-r--r-- | client/speaker.py | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/client/speaker.py b/client/speaker.py index df63eee..54a039f 100644 --- a/client/speaker.py +++ b/client/speaker.py @@ -40,22 +40,11 @@ class AbstractSpeaker(object): def say(self, phrase, *args): pass - def play(self, filename, chunksize=1024): - f = wave.open(filename, 'rb') - p = pyaudio.PyAudio() - stream = p.open(format=p.get_format_from_width(f.getsampwidth()), - channels=f.getnchannels(), - rate=f.getframerate(), - output=True) - - data = f.readframes(chunksize) - while data: - stream.write(data) - data = f.readframes(chunksize) - - stream.stop_stream() - stream.close() - p.terminate() + def play(self, filename): + # FIXME: Use platform-independent audio-output here + # See issue jasperproject/jasper-client#188 + cmd = ['aplay', str(filename)] + subprocess.call(cmd) class AbstractMp3Speaker(AbstractSpeaker): """ |
