5 # Monitor the default sink
6 DEFAULT_OUTPUT_MONITOR="$(pacmd stat | grep "Default sink" | cut -d ':' -f 2 | tail -c+2).monitor"
8 # Take the most recent source as the microphone (in my case it's a USB
9 # microphone I plugged in after pulseaudio started).
10 MICROPHONE=$(pactl list short sources | tail -1 | cut -f 2)
13 gst-launch-1.0 -v -e \
14 compositor name=mix sink_1::xpos=256 sink_2::ypos=256 \
15 ! 'video/x-raw, width=512, height=512, framerate=(fraction)30/1' \
18 pulsesrc device="$DEFAULT_OUTPUT_MONITOR" \
19 ! deinterleave name=deint \
23 ! 'video/x-raw, width=256, height=256, framerate=(fraction)30/1' \
24 ! textoverlay valignment=center font-desc='Sans, 50' text='Left speaker' \
30 ! 'video/x-raw, width=256, height=256, framerate=(fraction)30/1' \
31 ! textoverlay valignment=center font-desc='Sans, 50' text='Right speaker' \
34 pulsesrc device="$MICROPHONE" \
37 ! 'video/x-raw, width=512, height=256, framerate=(fraction)30/1' \
38 ! textoverlay valignment=center font-desc='Sans, 50' text='Microphone' \