Dropouts in audioPlayerRecorder audio streaming loop

2 次查看(过去 30 天)
Hi,
I have been trying to run an audioPlayerRecorder object smoothly, i.e., without any under/overruns. No matter what I have tried - different OS, tweaking buffer size etc - I am still getting initial dropouts. I tried adding zeros in the beginning of the signal but the underruns are still creating probelm when I extract the signal later in the script. I am not able to understand what exactly is going on. Please help.

回答(1 个)

Kiran Felix Robert
编辑:Kiran Felix Robert 2021-2-5
Hi Stance,
As a first step, you can run the Measure Audio Latency example to verify that your audio I/O system is configured correctly:
For profiling your code:
You can also go through the following link that has several steps to troubleshoot the issue of signal dropping and latency
As far as what we observe, under/overruns sometimes happen the first time we run, but usually we're good every other execution because all the underlying code is now cached in memory.
If none of the above links helps, then we need to inspect if the issue is due to hardware limitation of the device being used or the system being used.
This results when the processing loop in MATLAB is not able to supply samples at the rate the sound card demands due to system hardware limitation.
Although we cannot guarantee a processing speed to achieve the task, we would like to suggest you setting up some profiling of your algorithm or try reducing sample rate which might give better results.
There might be another possible issue that Some devices have a control panel to set the buffer length, it should match what is being used in the code. Hence if latency is not an issue , try increasing buffer length.

类别

Help CenterFile Exchange 中查找有关 Audio I/O and Waveform Generation 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by