I was searching for a way to read the sound playing on the system. I have already found a way to record audio data from my microphone via pyaudio
:
import numpy as np
import pyaudio
p = pyaudio.PyAudio()
stream = p.open(format=pyaudio.paInt16, channels=1, rate=RATE, input=True,
frames_per_buffer=CHUNKSIZE)
soundData = np.frombuffer(data, dtype=np.int16)
My problem is: I don't want to record my microphone sounds but my system sounds (if I have any music running etc.)
Are there any possibilities to achieve this? Or do I have to grab the sound data via an external device?