From 0397183f2a6ebd7ff294bb08db91aaf7ee026a53 Mon Sep 17 00:00:00 2001 From: martin legrand Date: Sat, 22 Mar 2025 13:34:05 +0100 Subject: [PATCH] fix : error pyaudio import --- sources/speech_to_text.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/speech_to_text.py b/sources/speech_to_text.py index 016ac2f..92f50b3 100644 --- a/sources/speech_to_text.py +++ b/sources/speech_to_text.py @@ -5,6 +5,8 @@ import numpy as np import torch import time from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline +import librosa +import pyaudio audio_queue = queue.Queue() done = False @@ -14,8 +16,6 @@ class AudioRecorder: AudioRecorder is a class that records audio from the microphone and adds it to the audio queue. """ def __init__(self, format: int = pyaudio.paInt16, channels: int = 1, rate: int = 4096, chunk: int = 8192, record_seconds: int = 5, verbose: bool = False): - import librosa - import pyaudio self.format = format self.channels = channels self.rate = rate