How to record audio with minimum time delay?

4 views (last 30 days)
I would like to record audio and and analyze it in real-time. The ideal case is to analyze data without interrupting the recording, so that I won't drop any data point in the audio stream. In practical, I can tolerate missing about 1% of the data, so I wrote some code as the below:
arec = audiorecorder(fs_rec,bits,channels,deviceID); while 1 recordblocking(arec,1); sample = getaudiodata(arec); analyze(sample); end
The analyze and getaudiodata function together takes time 0.001 second, so I can tolerate that. The problem is, the function recordblocking takes 1.5 second to record 1.0 second data, and this 0.5 second overhead really causes problems. Is there a way to avoid this overhead time delay, or at least to make it much smaller?

Answers (0)

Categories

Find more on Audio I/O and Waveform Generation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!