Tried like this:
p = pyaudio.PyAudio()
stream = p.open(format=FORMAT,
channels=CHANNELS,
rate=RATE,
output=True,
frames_per_buffer=chunk)
all = []
for i in range(0, int(RATE / chunk * RECORD_SECONDS)):
data = stream.read(chunk)
but it throws paCanNotReadFromAnOutputOnlyStream
Using input=True it reads audio from mic, but that is not what I need.
Any help, please
Edit: I am using linux
I can also use other library, not only PyAudio. I just need to get this work