diff --git a/avs/player/mpg123_player.py b/avs/player/mpg123_player.py index 0974190..3784241 100644 --- a/avs/player/mpg123_player.py +++ b/avs/player/mpg123_player.py @@ -47,26 +47,26 @@ def play(self, uri): self.event.set() if self.process and self.process.poll() == None: - os.write(self.tty, 'q') + os.write(self.tty, b'q') self.state = 'PLAYING' def stop(self): if self.process and self.process.poll() == None: - os.write(self.tty, 'q') + os.write(self.tty, b'q') self.state = 'NULL' def pause(self): if self.state == 'PLAYING': self.state = 'PAUSED' - os.write(self.tty, 's') + os.write(self.tty, b's') print('pause()') def resume(self): if self.state == 'PAUSED': self.state = 'PLAYING' - os.write(self.tty, 's') + os.write(self.tty, b's') # name: {eos, ...} def add_callback(self, name, callback): diff --git a/avs/player/mpv_player.py b/avs/player/mpv_player.py index 60f5d95..1272c5f 100644 --- a/avs/player/mpv_player.py +++ b/avs/player/mpv_player.py @@ -44,13 +44,13 @@ def play(self, uri): self.event.set() if self.process and self.process.poll() == None: - os.write(self.tty, 'q') + os.write(self.tty, b'q') self.state = 'PLAYING' def stop(self): if self.process and self.process.poll() == None: - os.write(self.tty, 'q') + os.write(self.tty, b'q') self.state = 'NULL' def pause(self): @@ -63,7 +63,7 @@ def pause(self): def resume(self): if self.state == 'PAUSED': self.state = 'PLAYING' - os.write(self.tty, ' ') + os.write(self.tty, b' ') # name: {eos, ...} def add_callback(self, name, callback):