Simple procedure for bare bones audio mixing with Linux. Sample case is a voiceover of some audio content. PulseAudio loopback will allow mixing of mic input with some other audio input (like music being played in a browser) and recording in audacity by selecting "Monitor of Built-in Analog Stereo" as input on the Recording tab of pavucontrol.
Thanks to Iñigo Aldazabal (iamc) for the code.
- Ubuntu 18.04 LTS with Gnome Shell.
- Both pavucontrol and audacity installed.
- Samson Q1U usb microphone.
Only my primary mic, the Q1U is connected.
Configuration tab in pavucontrol:
- ATI HDMI is Off
- Q1Y dynamic microphone set to Analog Mono Input
- Bult-in Audio set to Analog Stereo Duplex
Audacity preferences under Devices... Interface:
- Playback device: pulse
- Recording device Device: Samson Q1U: USB Audio (hw:1,0)
- Recording device Channels: 1 (Mono)
Use the following script (micloopback) to turn pulseaudio loopback on and off:
#!/bin/bash
# Loads / unloads pulseaudio loopback module in order to eg. be redirect
# mic input to headphones.
# Usage: micloopback [on|off]
#
if [ $# -ne 1 ]; then
echo "Usage: $0 [on|off]"
exit 1
fi
if [[ $1 == "on" ]]; then
pactl load-module module-loopback latency_msec=1
echo "pulseaudio loopback module loaded"
elif [[ $1 == "off" ]]; then
pactl unload-module module-loopback
echo "pulseaudio loopback module unloaded"
else
echo "Usage: $0 [on|off]"
fi
I placed mine under ~/bin/ and set it executable.
- Enable pulseaudio loopback:
$ micloopback on
-
Open audacity.
-
Open content you want to mix. Here's a fairly long sample:
-
Hit record on audacity and start your sample audio.
-
Go to pavucontrol, Recording tab, and set "Monitor of Built-in Analog Stereo".
-
Start talking into mic.
-
Stop recording in audacity and stop sample audio. Stop talking.
-
Turn off loopback:
$ micloopback off
- Play back audacity recording to confirm voiceover worked..