From 12b6447a87da8077c7dd12b92eefc27dcf7f0818 Mon Sep 17 00:00:00 2001 From: yum Date: Wed, 8 Mar 2023 15:36:46 -0800 Subject: Set PYTHONPATH in synchronous multiprocessing layer A user saw an error like `ModuleNotFoundError: No module named _socket`. StackOverflow blames this on PYTHONPATH, so let's try setting it. * Fix latent bug in Scripts/transcribe.py. PyAudio.open() positional parameters must be specified in correct order, even when telling it which parameter is which. *shrug* --- Scripts/transcribe.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Scripts') diff --git a/Scripts/transcribe.py b/Scripts/transcribe.py index c4d7682..6793336 100644 --- a/Scripts/transcribe.py +++ b/Scripts/transcribe.py @@ -167,8 +167,10 @@ def getMicStream(which_mic): # Bind audio_state to onAudioFramesAvailable callback = partial(onAudioFramesAvailable, audio_state, input_rate) - audio_state.stream = audio_state.p.open(format=audio_state.FORMAT, - channels=audio_state.CHANNELS, rate=input_rate, + audio_state.stream = audio_state.p.open( + rate=input_rate, + channels=audio_state.CHANNELS, + format=audio_state.FORMAT, input=True, frames_per_buffer=audio_state.CHUNK, input_device_index=device_index, stream_callback=callback) -- cgit v1.2.3