Audio output from firefox mixed with microphone

Is it possible to mix audio output from Firefox with microphone, for live communications.
For example, an audio output from youtube + my microphone when I am in an audio call.

best method to mix audio playback and microphone is to use jack_mixer

but there were discussions on old forum about mixing in Pulseaudio
[solved] Recording sound from two microphones? - Manjaro Linux Forum
Voicemeeter equivalent for linux - General Discussion - Manjaro Linux Forum
but i am not happy about using pavucontrol for mixing audio, so i am looking to use OBS audio mixer instead for a solution in Pulseaudio

Maybe this could be useful:

https://wiki.archlinux.org/index.php/PulseAudio/Examples#Mixing_additional_audio_into_the_microphone’s_audio

I have a similar setup with pulseaudio for obs and it works perfectly.

This could be useful too:

Never actually tried the method myself, i only used virtual audio cable on windows before.

If you feel like to be more experienced try this:

cp /etc/pulse/default.pa ~/.config/pulse/default.pa

then add the SINKs you need there.

pulseaudio -k will kill the service and load the config.

Here are all modules: https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Modules

No HDMI audio - Newbie Corner - Manjaro Linux Forum
suggest you check previous posts about why using pulseaudio -k (or --kill )
is not a good idea

to restart pulseaudio without causing harm to systemd or pulseaudio:

systemctl --user restart pulseaudio
1 Like

Ah ok… this works also. I was just used to do it like this and had no problems after all. :slight_smile:

Thank you guys for all of your replies, but I find them quite difficult to follow, is there something like copy/paste or much easier to follow?

Thank you again.

From jack_mixer I am getting
ERROR: Mixer creation failed (error creating mixer, probably jack is not running).

Manjaro usually has jackd package installed but is not configured for realtime audio to start and use JACK
there is a python script that can check an installed system and suggest required changes
realtimeconfigquickscan
(i am working on an idea for a simpler script + JACK tutorial for Manjaro users)

also need either cadence or qjackctl to control JACK and manage audio connections

(in my opinion, JACK is similar to using ASIO/GSIF drivers on the other OS rather than virtual cables)

a solution in Pulseaudio would be preferred by some users because they are more familiar with Pulseaudio and it is usually running and working in most Manjaro systems
but the usual pulseaudio mixer GUI is not good for working with the additional modules
best i can offer for Pulseaudio at this moment is this bash script:

gist.github.com/nik-gnomic/PulseaudioVoipMix.sh

but OBS appears be a better option for a GUI and will not require all these additional modules
[/quote]

Thanks for the reply, but I am getting this error:

./PulseaudioVoipMix.sh: line 7: microphone: command not found
./PulseaudioVoipMix.sh: line 9: headphone: command not found
31
./PulseaudioVoipMix.sh: line 14: microphone: command not found
Failure: Module initialization failed
./PulseaudioVoipMix.sh: line 16: headphone: command not found
33

I replaced variables with current strings and it works. Is there a way for me no to hear my microphone on headphones?

Thanks!

I replaced variables with current strings and it works.

i only added the variables to make the module loading commands easier to read
the variables in my gist do not work intentionally. user must find the correct sink and source names for their system

Is there a way for me no to hear my microphone on headphones?

microphone audio loopback should only be connected to null sink (voipmix)
not simultaneous output (voipmix + headphones)
imgur.com - voipmix - pavucontrol --tab1
more detailed explanation was on old forum thread

Voicemeeter equivalent for linux

Voicemeeter equivalent for linux
once the modules are loaded and configured correctly, it is better to change pulseaudio playback tab to Show: Applications to hide the virtual connecctions

each audio stream can be assigned in pavucontrol --tab=1 to one of three options in drop-down menu:

  1. Built-in Audio Analog Stereo(headphones)
    audio from callers on zoom must be routed only to headphones
    if audio from zoom call is sent to null Output (including Simultaneous Output) callers voice is echoed back at them with a delay and they are unlikely to be able to talk over it
    so it must be kept away from the null-sink
  2. Null Output
    microphone must be routed to null sink only
    audio is delayed by looping around in pulseaudio and is not usable for monitoring. user can usually monitor microphone audio with no delay in ALSA or direct from audio device
  3. Simultaneous Output… - audio to headphones and null-sink mix for discord
    audio routed to simultaneous output will be audible in headphones and for zoom callers

this screenshot shows the 3 connections in use -
QMMP playing to Analog Output (headphones)
Deadbeef playing to Null Output
Firefox playing to both sinks using Simultaneous Output

microphone audio will be slightly delayed from being looped through pulseaudio and will sound strange if it can be heard in headphones

Thanks, I was able to stop hearing my mic on headphone.

About the error, I mean the bash complains because it reads the variable as command, not the value.

I have corrected the gist script and it is working for me, and it passes shellcheck with no errors

The variables can be bypassed and names added to create a basic script, but I have an idea to try to detect sink and source names from the system so user can choose the correct device names. USB devices can change names, and many systems have more than one active device, so this script needs a more reliable way to set the headphone and microphone

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.