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 日

1 投票

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