How can I process speech without stopping the recording in MATLAB?

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

Respuesta aceptada

Walter Roberson
Walter Roberson el 14 de Mayo de 2012
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.
  1 comentario
Gun-min Kim
Gun-min Kim el 14 de Mayo de 2012
Thanks for your reply !
But unfortunately, my OS is 64bit (win64 platform) so I cannot use 'analoginput' according to the MATLAB error message. Can you show some simple example codes that I can refer? It can be very helpful for solving my problem.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Code Generation and Deployment en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by