import soundcard as sc
import soundfile as sf
from threading import Thread
OUTPUT_FILE_NAME = "out.wav"
SAMPLE_RATE = 48000
RECORD_SEC = 10
with sc.get_microphone(id=str(sc.default_speaker().name), include_loopback=True).recorder(samplerate=SAMPLE_RATE) as mic:
data = mic.record(numframes=SAMPLE_RATE*RECORD_SEC)
with sc.get_microphone(id=str(sc.default_microphone().name), include_loopback=True).recorder(samplerate=SAMPLE_RATE) as mic:
data1 = mic.record(numframes=SAMPLE_RATE*RECORD_SEC)
data3 = data + data1
sf.write(file="micout.wav", data=data1[:, 0], samplerate=SAMPLE_RATE)
sf.write(file="sysout.wav", data=data[:, 0], samplerate=SAMPLE_RATE)
sf.write(file="mixed.wav", data=data3[:, 0], samplerate=SAMPLE_RATE)
I want to capture the specific process audio (like - only from the google chrome )
I have tried the soundcard and pyaudio but i have not able to achieve it