I'm on Lubuntu 19.10 and I would like to create a virtual microphone that can be used from other software (eg. the browser) as an audio source and pipe audio to it in real time using a python script.
Since now I tried different solution and I now have a virtual device named
MicOutput which I created using the following command:
pactl load-module module-null-sink sink_name=MicOutput sink_properties=device.description="Virtual_Microphone_Output"
How can I send audio to it using Python?
EDIT: I solved as showed in the answer below, but how can I change at least the output of the script to the virtual microphone automatically when I launch it? I mean there is a command to execute in terminal to do that?