MATLAB: How to process speech without stopping the recording in MATLAB

MATLABmulti-threadingParallel Computing Toolbox

I am currently process speech signal with recording simultaneously.
More specifically,
(1) Record every 0.1s speech repeatedly.
(2) Process each speech chunk(0.1s) as FIFO sense. (let say processing function 'test') 'test' function takes about 1s for processing each chunk of speech.
I wrote the code as follows :
r = audiorecorder(fs,16,1);
record(r,0.1);
data{k} = getaudiodata(r);
test(data{k});
The problem is that I miss sample of 1s speech during 'test' function is executed. I want recording to be executed without stop, and call the function 'test' in every 0.1s speech recording.
So, I try to use function callback provided for 'audiorecorder'. I used StopFcn , which is the function to be executed just after stopping record, But this function callback used same thread with recording. So,I need to try other approaches.
I got a clue that 'multi-threading', 'parallel computing toolbox' would be helpful for me. But I don't know how to apply it for my problem.
Is there anyone who can give me some advice? I really appreciate all of your comments.

Best Answer

You will probably not be able to do this using audiorecorder. You will probably have to switch to a data-acquisition design. analoginput() from the device, set up a BytesAvailableFcn callback that queues the data into an internal buffer. Your regular routine would loop around looking in the queue for work and processing what it finds there.
Related Question