diff --git a/hugvey/client.py b/hugvey/client.py index d3c015b..b6bd27a 100644 --- a/hugvey/client.py +++ b/hugvey/client.py @@ -308,7 +308,8 @@ class CommandHandler(object): 'event': 'playbackStart', 'msgId': msgId }) - returnCode = self.playPopen.wait() + out, err = self.playPopen.communicate() + returnCode = self.playPopen.returncode logger.debug('finished') self.playPopen = None else: @@ -316,11 +317,12 @@ class CommandHandler(object): playCmd = ['espeak', '-p', '{0}'.format(pitch), text] self.playPopen = subprocess.Popen( playCmd, stdout=subprocess.PIPE) - returnCode = self.playPopen.wait() + out, err = self.playPopen.communicate() + returnCode = self.playPopen.returncode self.playPopen = None if returnCode: - logger.critical("Had returncode {} on play: {}".format(returnCode, playCmd)) + logger.critical("Had returncode {} on play: {}\n\n{}\n{}".format(returnCode, playCmd, out, err)) else: logger.debug("Finished playback.")