Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

virtual mic with python

>>> from pygame._sdl2 import get_num_audio_devices, get_audio_device_name #Get playback device names
>>> from pygame import mixer #Playing sound
>>> mixer.init() #Initialize the mixer, this will allow the next command to work
>>> [get_audio_device_name(x, 0).decode() for x in range(get_num_audio_devices(0))] #Returns playback devices
['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() #Quit the mixer as it's initialized on your main playback device
>>> mixer.init(devicename='CABLE Input (VB-Audio Virtual Cable)') #Initialize it with the correct device
>>> mixer.music.load("Megalovania.mp3") #Load the mp3
>>> mixer.music.play() #Play it
Comment

PREVIOUS NEXT
Code Example
Python :: get absolute url 
Python :: how to reshape dataframe in python 
Python :: np.to_csv 
Python :: discord bot delete messages python 
Python :: how to add a file to an email in python 
Python :: opencv namedwindow 
Python :: python dictonary set default 
Python :: how to split a string with newline in python 
Python :: python string to lower 
Python :: max value indices 
Python :: how can i remove random symbols in a dataframe in Pandas 
Python :: merge multiple excel files with multiple worksheets into a single dataframe 
Python :: create panda dataframe 
Python :: laplace transform python 
Python :: pytohn reset all dictionary values to 0 
Python :: how to check for empty dataframe 
Python :: numpy.sign() in Python 
Python :: delete rows in a table that are present in another table pandas 
Python :: python count of letters in string 
Python :: python help 
Python :: split string into groups of 3 chars python 
Python :: get file in file zip python 
Python :: python euclidean distance 
Python :: edit error page flask 
Python :: Simple Splash screen in pyqt5 
Python :: cv2 read rgb image 
Python :: get UTC time for IST time python 
Python :: list in list python 
Python :: reshape python 
Python :: Django migrations when table already exist in database 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =