WasHeisstKnock
WasHeisstKnock

Reputation: 23

How can i read my headphone output with Python?

Hello i was wondering how i can read my headphone monitor output with python. I tried to do it with python3 and pyaudio but i just got it to work with my microphone.

Here is my code i tried to do for my Headphones, but that didn't work. output_device_index=26 is my headset monitor.

FORMAT = pyaudio.paInt16
CHANNELS = 2
RATE = 48000
CHUNK = 1024
RECORD_SECONDS = 5
 
audio = pyaudio.PyAudio()
 
# start Recording
stream = audio.open(format=FORMAT, channels=CHANNELS,
                rate=RATE, input=True,
                frames_per_buffer=CHUNK, input_device_index=26)

My error:

malloc(): mismatching next->prev_size (unsorted)
Aborted (core dumped)

Upvotes: 1

Views: 360

Answers (0)

Related Questions