无法使用open()使用PyAudio打开流

时间:2019-11-24 00:06:08

标签: python pyaudio

我正在这样做:

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)

我得到

  

回溯(最近通话最近):文件   “ C:/用户/ Rama / PycharmProjects /与文本无关的扬声器识别系统主/代码/main.py”,   第45行,在       输出= False)文件“ C:\ Users \ Rama \ Text-Independent-Speaker-Indentification-System-master \ lib \ site-packages \ pyaudio.py”,   750行,处于打开状态       流=流((自身,* args,** kwargs)文件“ C:\ Users \ Rama \ Text-Independent-Speaker-Indentification-System-master \ lib \ site-packages \ pyaudio.py”,   第441行,在 init 中       self._stream = pa.open(** arguments)OSError:[Errno -9996]无效的输入设备(无默认输出设备)

怎么了?

0 个答案:

没有答案