4

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?

2

I solved changing manually the output of the python script and the input of the web application to the virtual microphone created with the previous command, using the pavucontrol or pulseaudio GUI.

I add some images to be more clear.

To direct audio output from python script to the virtual microphone To direct audio output from python script to the virtual microphone

To use monitor of the virtual microphone as source for a specific tab in firefox To use monitor of the virtual microphone as source for a specific tab in firefox

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.