Skip to content

Commit

Permalink
performance: speed up b64 operations
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Dec 23, 2024
1 parent 40b93cc commit 4047842
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions hivemind_mic_sat/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import base64
import pybase64
import os.path
from queue import Queue
from typing import Optional, List
Expand Down Expand Up @@ -137,7 +137,7 @@ def handle_speak_b64(self, message: Message):
utt = message.data["utterance"]
audio_file = f"/tmp/{hash_sentence(utt)}.wav"
with open(audio_file, "wb") as f:
f.write(base64.b64decode(b64data))
f.write(pybase64.b64decode(b64data))
LOG.info(f"TTS: {audio_file}")
self.playback.put(audio_file,
listen=message.data.get("listen"),
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
hivemind_bus_client>=0.1.0,<1.0.0
ovos-plugin-manager<1.0.0
ovos-audio<1.0.0
click
click
pybase64

0 comments on commit 4047842

Please sign in to comment.