From 244ce968232966df350f411fd83bfe4d767cfe25 Mon Sep 17 00:00:00 2001 From: AIWintermuteAI Date: Thu, 24 Oct 2024 10:33:38 +0200 Subject: [PATCH 1/2] make sure pyaudio is installed --- requirements.txt | 1 + setup.cfg | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index a644665..2538bf3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,3 +2,4 @@ numpy>=1.19 PyAudio==0.2.11 psutil>=5.8.0 edge_impulse_linux +six==1.16.0 \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 1fbd8d6..fd56f7c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -16,6 +16,4 @@ classifiers = [options] packages = find: python_requires = >=3.6 -install_requires = - numpy>=1.19 - psutil>=5.8.0 +install_requires = file: requirements.txt From aac13604902f16374d0f1ba47b20246f8ad1216a Mon Sep 17 00:00:00 2001 From: AIWintermuteAI Date: Thu, 24 Oct 2024 10:33:43 +0200 Subject: [PATCH 2/2] look for 0x0 in the end of the chunk --- edge_impulse_linux/runner.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/edge_impulse_linux/runner.py b/edge_impulse_linux/runner.py index 9904979..5e33863 100755 --- a/edge_impulse_linux/runner.py +++ b/edge_impulse_linux/runner.py @@ -87,9 +87,14 @@ def send_msg(self, msg): t_sent_msg = now() - # i'm not sure if this is right, we should switch to async i/o for this like in Node - # I think that would perform better - data = self._client.recv(1 * 1024 * 1024) + data = b"" + while True: + chunk = self._client.recv(1024) + # end chunk has \x00 in the end + if chunk[-1] == 0: + data = data + chunk[:-1] + break + data = data + chunk t_received_msg = now()