无法使用open()打开带有PyAudio的流

2024-09-28 17:00:51 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在这样做:

BLOCKSIZE = 64  # Number of frames per block
WIDTH = 2       # Number of bytes per sample
CHANNELS = 1    # mono
RATE = 44100    # Sampling rate (samples/second)
RECORD_SECONDS = 30     # Time lasts for Recording

p1 = pyaudio.PyAudio()

stream1 = p1.open(format = p1.get_format_from_width(WIDTH),
                channels = CHANNELS,
                rate = RATE,
                input = True,
                output = False)

我越来越

Traceback (most recent call last): File "C:/Users/Rama/PycharmProjects/Text-Independent-Speaker-Indentification-System-master/Code/main.py", line 45, in output = False) File "C:\Users\Rama\Text-Independent-Speaker-Indentification-System-master\lib\site-packages\pyaudio.py", line 750, in open stream = Stream(self, *args, **kwargs) File "C:\Users\Rama\Text-Independent-Speaker-Indentification-System-master\lib\site-packages\pyaudio.py", line 441, in init self._stream = pa.open(**arguments) OSError: [Errno -9996] Invalid input device (no default output device)

怎么了


Tags: textpymasteroutputlineopensystemusers