Closed pvitaliy84 closed 3 years ago
If you mean "capture what comes in through the microphone and play it back through the speaker", I'm afraid it isn't that easy. Chances are that capture and playback might have different master clocks, leading to clock drift eventually. Compensating for clock drift is beyond what simple ALSA bindings do, you probably want a higher level library to do this. Maybe gstreamer or pulseaudio can do this?
For what its worth, a while back I made a program called fraust-echo. There's a branch for alsa-rs, rust-portaudio, portaudio-rs, and I think one other toolkit. Alas its 5 years old now.
Anyway, code is here and it basically copies samples from input, runs them through some DSP, and the samples go to output.
Thanks. Maybe gstreamer or pulseaudio
Please, I very need example "Capture and Playback" (Stereo Microphone) in infinity loop.