0

Im using mini usb microphone for recording audio. The sound is not good so i trying connect 3 more (total 4) mini usb microphones. I tried arecord --device=hw:1,0 --format S16_LE --rate 44100 -V mono -c1 voice.wav so how i can record with 4 microphones? What config file and how i must edit it? :(

4
  • so, do you want to record to 4 different files one from each of the 4 microphones, or are you trying to record from 4 microphones into one file? Apr 26, 2021 at 23:51
  • I want record from 4 microphones into one file
    – JiriK
    Apr 27, 2021 at 6:33
  • so what devices are available to record from? e.g. you've shown hw:1,0 - what else is there? Apr 27, 2021 at 8:40
  • here's some alsa documentation that will help - it's using two stereo input devices to create a virtual 4 channel device ... but you should be able to extrapolate how to use 4 mono input devices to do the same (you'll have slave a,b,c,d with 1 channel each and the bindings channel will all be channel 0) alsa-project.org/main/index.php/… Apr 27, 2021 at 8:55

1 Answer 1

0

Based on documentation I found here - extrapolating for 4 mono real devices as opposed to 2 stereo real devices as per the documentation

add this to .asoundrc

pcm.multi {
    type multi;
    slaves.a.pcm "hw:1,0";
    slaves.a.channels 1;
    slaves.b.pcm "hw:2,0";
    slaves.b.channels 1;
    slaves.c.pcm "hw:3,0";
    slaves.c.channels 1;
    slaves.d.pcm "hw:4,0";
    slaves.d.channels 1;
    bindings.0.slave a;
    bindings.0.channel 0;
    bindings.1.slave b;
    bindings.1.channel 0;
    bindings.2.slave c;
    bindings.2.channel 0;
    bindings.3.slave d;
    bindings.3.channel 0;
}

ctl.multi {
    type hw;
    card 1;
}

then you can

arecord --device=multi --format S16_LE --rate 44100 -c4 voice.wav

I can't check the above, I only have two such dongles, but excluding c/d slaves does allow me to record stereo from 2 x mono inputs - so I imagine this should work just fine

I'm also assuming the device ID's as being hw:1,0 -> hw:4,0 - but that seems to be a safe bet

I also excluded the pcm.ttable etc stuff as you didn't mention JACK at all

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.