Pulseaudio

From Halfface
Jump to navigation Jump to search

record several sources.

In pavucontrol. Recording tab.

With 'All Streams' selected on the bottom of the page, the two Loopback streams become visible.

Using the buttons to the right of the Loopback entries, select the MIC for one of them, and select 'Monitor of .. ' the the built in Audio for the other.

Now launch your preferred recording application. It too will appear on the Recording tab when a recording is started.

Set it to record from "Monitor of Null Output" that is the mixed sound stream.

Script to create sink with multiple connected loopbacks.

#!/bin/bash

### This script sets up two loopback virtual devices and a null sink
### which can then be used to mix inputs and record the result.
### It requires a functioning PulseAudio installation and also
### PulseAudio Volume Control to manage the streams.
# License: GPL 2 or later
# Author: clareoldie
# Date: June 1st 2012


set -x
unload-modules () {
### First detect then unload loopback devices
for i in $(pactl list | grep -B 1 'Name: module-loopback' | grep 'Module #' | cut -d '#' -f 2-)
do
pactl unload-module $i
done
### Next detect and unload the Null-Sink device/s
for i in $(pactl list | grep -B 1 'Name: module-null-sink' | grep 'Module #' | cut -d '#' -f 2-)
do
pactl unload-module $i
done
}

load-modules () {
### Load required modules
pactl load-module module-null-sink sink_name=MySink
pactl load-module module-loopback sink=MySink
pactl load-module module-loopback sink=MySink
}

test-modules () {
## If the modules exist 0$?=0 then unload them, else load them.
pactl list | grep -B 1 'Name: module-loopback'
if [ "$?" = "0" ]
then
unload-modules
exit 0
fi
pactl list | grep -B 1 'Name: module-null-sink'
if [ "$?" = "0" ]
then
unload-modules
exit 0
else
load-modules
fi
}

### Main Programme
test-modules


http://www.pclinuxos.com/forum/index.php/topic,105968.0.html