Reputation: 21
I've started working on a graphic equalizer app in python, my goal is to be able to eq the sound played by applications such as youtube. The simplest solution seems to be to record audio using WASAPI loopback on a silent output, modify it, then play it back on the actual speakers. I've managed to get that working, however this only works if there is more than one speaker available, which often isn't the case with laptops.
import soundcard as sc
import numpy
inputLib = sc.all_microphones(include_loopback=True)
outputLib = sc.all_speakers()
inputSource = inputLib[1] # The headphone output loopback
speakers = outputLib[3] # The speakers I'd actually like to hear the audio on
data = inputSource.record(samplerate=48000, numframes=480000)
# **modify audio here**
speakers.play(data/numpy.max(data), samplerate=48000)
Question is, is there a way in python to create a virtual speaker on windows, without using 3rd party apps such as VB-CABLE?
Upvotes: 2
Views: 624