Skip to content
Advertisement

How to loop back the microphone entry directly to speakers on linux?

I would like to loop back a USB microphone entry to an audio output on linux (raspbian OS).

When i speak into the microphone, i would like to immediatly hear it to the speakers, with minimal delay.

I haven’t found any open source project that do it.

Do you you know how to do it, by programming, reading writing on devices, or if there is a small piece of OSS that can do it ?

Thanks

Loïc

Advertisement

Answer

You can achieve it through arecord | aplay pipeline in linux.

Check the sound card and device number of usb device through aplay -l (for Playback) and arecord -l (for Capture).

Then run the below command to concurrently recording and playback:

arecord -Dhw:<card_num>,<device_num> -c <channel_number> –f <format> -r <sample_rate> | aplay -Dhw:<card_num>,<device_num>

You can add more parameter if required for playback or capture.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement