Hi I am trying to run a code where the following libraries are imported:
from RealtimeSTT import AudioToTextRecorder, from queue import Queue, import mediapipe as mp, import threading as tr, import pygame, import random, import math, import time, import cv2 import os
I am running on Visual Studio Code on a MacBook Pro M3. the error I get is as follows:
ERROR:root:Error initializing pyaudio audio recording: [Errno -9998] Invalid number of channels
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/RealtimeSTT/audio_recorder.py", line 700, in _audio_data_worker
stream = audio_interface.open(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pyaudio/__init__.py", line 639, in open
stream = PyAudio.Stream(self, *args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pyaudio/__init__.py", line 441, in __init__
self._stream = pa.open(**arguments)
OSError: [Errno -9998] Invalid number of channels
Process Process-2:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/RealtimeSTT/audio_recorder.py", line 700, in _audio_data_worker
stream = audio_interface.open(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pyaudio/__init__.py", line 639, in open
stream = PyAudio.Stream(self, *args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pyaudio/__init__.py", line 441, in __init__
self._stream = pa.open(**arguments)
OSError: [Errno -9998] Invalid number of channels
I can’t figure out how to solve the problem, I didn’t find anything by searching on google. Thanks!
Alessio Buccarella is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.