Audio Software - theunissenlab/lab-documentation GitHub Wiki

None of this is in use - im just taking notes on how to configure audio streams in ubuntu in case i need it

Trying to create a single audio channel to read in pyaudio

(portaudio must be installed to use pyaudio)

Pulseaudio is a program that abstracts lower level audio handling. Inputs (i.e. mics) are hardware "sources" and Outputs (i.e. speakers) are hardware "sinks".

The advantage of using pulseaudio is that you can configure how audio streams are passed around - for example, allowing multiple applications to receive the same audio stream, or join multiple audio streams into multiple channels on a single stream.

We will use this to join an arbitrary number of input microphones into a single audio stream with multiple channels that can be read by our python software.

  1. PyAudio in python requires portaudio (at least on ubuntu).

sudo apt-get install libasound-dev portaudio19-dev

  1. Set up a pulse audio virtual sink by the name of finch-mics-1

pacmd load-module module-null-sink sink_name=finch-mics-1 sink_properties=device.description=Finch-Mics-1

- Programs can listen to this sink using the source finch-mics-1.monitor
  1. Identify the sources that you want to join into the finch-mics-1 stream

pacmd list-sources

  1. Create a new virtual channel in the finch-mics sink (repeat the following command once for each channel you want to create)

pactl load-module module-loopback source="<source name>" sink="finch-mics-1"