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

15 views (last 30 days)
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)

Accepted Answer

Glenn Kubota
Glenn Kubota about 4 hours ago
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! :)

More Answers (0)

Categories

Find more on Downloads in Help Center and File Exchange

Products


Release

R2025b

Community Treasure Hunt

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

Start Hunting!