diff --git a/ovos_audio/service.py b/ovos_audio/service.py index 52a725c..d9565a2 100644 --- a/ovos_audio/service.py +++ b/ovos_audio/service.py @@ -283,10 +283,11 @@ def handle_b64_audio(self, message): ctxt = self.tts._get_ctxt({"message": message}) wav, _ = self.tts.synth(utterance, ctxt) - with open(wav, "rb") as f: + # cast to str() to get a path, as it is a AudioFile object from tts cache + with open(str(wav), "rb") as f: audio = f.read() - b64_audio = base64.b64encode(audio) + b64_audio = base64.b64encode(audio).decode("utf-8") self.bus.emit(message.response({"audio": b64_audio, "listen": listen, 'tts_id': self.tts.plugin_id,