diff --git a/sources/speech_to_text.py b/sources/speech_to_text.py index 776dce3..2d76c11 100644 --- a/sources/speech_to_text.py +++ b/sources/speech_to_text.py @@ -6,6 +6,7 @@ import torch from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline import time import librosa +import pyaudio audio_queue = queue.Queue() done = False @@ -14,7 +15,7 @@ class AudioRecorder: """ AudioRecorder is a class that records audio from the microphone and adds it to the audio queue. """ - def __init__(self, format: int, channels: int = 1, rate: int = 4096, chunk: int = 8192, record_seconds: int = 5, verbose: bool = False): + def __init__(self, format: int = pyaudio.paInt16, channels: int = 1, rate: int = 4096, chunk: int = 8192, record_seconds: int = 5, verbose: bool = False): import pyaudio self.format = format self.channels = channels