using wavrecord and getkey at the same time

65 Views Asked by At

(In Matlab:) I'm trying to run wavrecord and getkey at the same time. I mean, while recording sound from speaker I want Matlab get key pressed on keyboard. Of course I can do that by running two matlab program running at the same time, but I wonder if there is a way to do that at on Matlab program?

1

There are 1 best solutions below

0
On

I could resolve the problem. What we need to do is just to use "audiorecorder" instead of "wavrecord". the rest is simple.

Example:

r = audiorecorder(44100, 16, 1);

record(r); % speak into microphone...

... % use getkey

stop(r);