Process speech without stopping the recording in MATLAB

泪湿孤枕 提交于 2019-12-19 11:30:03

问题


I am currently processing speech signals while recording simultaneously. More specifically:

  1. Record every 0.1s speech repeatedly.

  2. Process each speech packet in a FIFO sense (e.g., call this function process). It takes about 1s for processing a packet of speech of length 0.1s.

The following is the the executed code:

r = audiorecorder(fs, 16,1);
data{k} = getaudiodata(r);
process(data{k});

The problem is that I miss sample of 1s speech during process execution. I want the recording to be executed without stop, and call the function process in every 0.1s speech recording. I try to use function callback provided for audiorecorder. The problem is that TimerFcn, which is the function to be executed repeatedly during recording, cannot retrieve the sample during recording.

Any advice?


回答1:


Try to find something in the matrix you get on using getaudiodata()

That must have some arrangement depending on time. (It should have some distribution of values according to time because plot() plots the sound signal wrt time axis)

Iterate through the matrix according to that arrangement and call the process() function.

This way you can record the sound at once and then process for every 0.1 secs one by one by iterating.



来源:https://stackoverflow.com/questions/10554195/process-speech-without-stopping-the-recording-in-matlab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!