virtual microphone python code example
Example: virtual mic with python
>>> from pygame._sdl2 import get_num_audio_devices, get_audio_device_name
>>> from pygame import mixer
>>> mixer.init()
>>> [get_audio_device_name(x, 0).decode() for x in range(get_num_audio_devices(0))]
['Headphones (Oculus Virtual Audio Device)', 'MONITOR (2- NVIDIA High Definition Audio)', 'Speakers (High Definition Audio Device)', 'Speakers (NVIDIA RTX Voice)', 'CABLE Input (VB-Audio Virtual Cable)']
>>> mixer.quit()
>>> mixer.init(devicename='CABLE Input (VB-Audio Virtual Cable)')
>>> mixer.music.load("Megalovania.mp3")
>>> mixer.music.play()