Commit af31dc5 1 parent b48a624 commit af31dc5 Copy full SHA for af31dc5
File tree 1 file changed +5
-16
lines changed
1 file changed +5
-16
lines changed Original file line number Diff line number Diff line change @@ -40,22 +40,11 @@ def is_available(cls):
40
40
def say (self , phrase , * args ):
41
41
pass
42
42
43
- def play (self , filename , chunksize = 1024 ):
44
- f = wave .open (filename , 'rb' )
45
- p = pyaudio .PyAudio ()
46
- stream = p .open (format = p .get_format_from_width (f .getsampwidth ()),
47
- channels = f .getnchannels (),
48
- rate = f .getframerate (),
49
- output = True )
50
-
51
- data = f .readframes (chunksize )
52
- while data :
53
- stream .write (data )
54
- data = f .readframes (chunksize )
55
-
56
- stream .stop_stream ()
57
- stream .close ()
58
- p .terminate ()
43
+ def play (self , filename ):
44
+ # FIXME: Use platform-independent audio-output here
45
+ # See issue jasperproject/jasper-client#188
46
+ cmd = ['aplay' , str (filename )]
47
+ subprocess .call (cmd )
59
48
60
49
class AbstractMp3Speaker (AbstractSpeaker ):
61
50
"""
You can’t perform that action at this time.
0 commit comments