From f1e685986d8d40120e10df243539766190b0979c Mon Sep 17 00:00:00 2001 From: liamcottle Date: Wed, 26 Nov 2025 01:17:19 +1300 Subject: [PATCH] hack to avoid numpy issue on windows caused by soundcard package --- meshchat.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/meshchat.py b/meshchat.py index 6a9605c..c49e191 100644 --- a/meshchat.py +++ b/meshchat.py @@ -18,6 +18,7 @@ import LXMF import LXST import RNS import RNS.vendor.umsgpack as msgpack +import numpy from LXMF import LXMRouter from LXST import Telephone from LXST.Primitives.Telephony import Profiles @@ -35,6 +36,10 @@ from src.backend.interface_editor import InterfaceEditor from src.backend.lxmf_message_fields import LxmfImageField, LxmfFileAttachmentsField, LxmfFileAttachment, LxmfAudioField from src.backend.sideband_commands import SidebandCommands +# hack to avoid below error on windows from soundcard/mediafoundation.py in self._record_chunk() +# ValueError: The binary mode of fromstring is removed, use frombuffer instead +numpy.fromstring = numpy.frombuffer + # NOTE: this is required to be able to pack our app with cxfreeze as an exe, otherwise it can't access bundled assets # this returns a file path based on if we are running meshchat.py directly, or if we have packed it as an exe with cxfreeze