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
This commit is contained in:
Jatin K Malik
2026-02-12 17:46:51 -08:00
committed by GitHub
parent 1e0a2a6cee
commit 8b4a1b2f50
@@ -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