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

20 visualizaciones (últimos 30 días)
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)

Respuesta aceptada

Glenn Kubota
Glenn Kubota el 23 de Dic. de 2025 a las 19:08
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! :)

Más respuestas (0)

Productos


Versión

R2025b

Community Treasure Hunt

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

Start Hunting!

Translated by