Getting audio every 20 milliseconds in ALSA?

I would like to call snd_pcm_readi () and get AUDIO DATA every 20 ms or every 40 ms. I want to know how to get my data synchronously ... this is every X ms ...

Thanks for any answers.

+5
source share
1 answer

To read or play in real time, you usually create a dedicated, high-priority workflow for the call, and then use several ring buffers. your thread should avoid blocking.

Examples

alsa:

http://www.alsa-project.org/alsa-doc/alsa-lib/_2test_2latency_8c-example.html#a36

http://www.alsa-project.org/alsa-doc/alsa-lib/_2test_2pcm_8c-example.html

, , , ( ).

+2

All Articles