Search code examples
raspberry-pi3gnu-parallel

Parallel arecord statements using GNU Parallel


I am new to Linux. I want to record from 2 microphones simultaneously. I know how to do separately. Some lag is tolerable. Is it possible to do that using arecord with GNU Parallel? I am using 2 USB soundcards.


Solution

  • At its simplest, you would get the list of devices with:

    arecord --list-devices
    

    Then, assuming your sound cards have hardware ids 1,0 and 2,0, you could do:

    parallel --dry-run arecord -D hw:{},0 -d 5 {}.wav ::: 1 2
    

    Sample Output

    arecord -D hw:1,0 -d 5 1.wav
    arecord -D hw:2,0 -d 5 2.wav
    

    If that looks correct, run again but omitting --dry-run.