From 8b4a1b2f5010e8ec58954a6df1b7bbf9167ca33e Mon Sep 17 00:00:00 2001 From: Jatin K Malik Date: Thu, 12 Feb 2026 17:46:51 -0800 Subject: [PATCH] fix(audio): resolve PyAudio paInt16 attribute error on reconnection (#204) The _attempt_audio_reconnection method was incorrectly accessing paInt16 as an attribute of the PyAudio instance instead of the pyaudio module. Added local import and fixed the reference. Fixes #203 --- src/vocalinux/speech_recognition/recognition_manager.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vocalinux/speech_recognition/recognition_manager.py b/src/vocalinux/speech_recognition/recognition_manager.py index 7c27706..32727fc 100644 --- a/src/vocalinux/speech_recognition/recognition_manager.py +++ b/src/vocalinux/speech_recognition/recognition_manager.py @@ -1661,6 +1661,8 @@ class SpeechRecognitionManager: Returns: bool: True if reconnection was successful, False otherwise """ + import pyaudio + self._reconnection_attempts += 1 if self._reconnection_attempts > self._max_reconnection_attempts: @@ -1689,7 +1691,7 @@ class SpeechRecognitionManager: # Stream configuration CHUNK = 1024 - FORMAT = audio_instance.paInt16 + FORMAT = pyaudio.paInt16 CHANNELS = 1 RATE = 16000