how are additional samples added to the audiostreamer playrec output queue?

If I use the audiostreamer 'play' function, I can add additional samples to the output queue by calling 'play' when NumberPlayerSamples gets low. But this doesn't work the same way for the 'playrec' function. If I call 'playrec' while there are samples in the output queue, it will not add to the output queue, but instead it replaces the output queue with the new samples. Thus, whatever was in the output queue previously was lost.
Is there some reason that it has to be that way? I attached some test code that sends multiple ASIO buffers of pink noise to the output queue and then it starts copying samples from the input to the output. I would expect that the latency from the input to the output would increase if I added more samples up front. Instead I see that it only outputs one buffer of pink noise and then starts copying the samples.
So, bug or intentional? (I vote bug)

 채택된 답변

Glenn Kubota
Glenn Kubota 2025년 12월 23일
After communicating with tech support, they pointed out that there is an example on the 'audiostreamer' page that streams audio using the 'record' and 'play' calls separately instead of the 'playrec' call. I guess I should learn to read the docs more carefully! :)

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Audio I/O and Waveform Generation에 대해 자세히 알아보기

제품

릴리스

R2025b

질문:

2025년 12월 19일

답변:

2025년 12월 23일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by