How to use "record" command for some amount of time?

조회 수: 4 (최근 30일)
Oai Vu
Oai Vu 2020년 6월 11일
댓글: Oai Vu 2020년 6월 12일
I want to record a signal
As I know, I can use the commands:
r = audiorecorder(8000,16,1);
record(r);
By this way, if I want to stop recording I've got to use the command:
stop(r);
The problem is I'm building a program in which I want to record for 10 seconds and things need to happen automatically. So if i use these:
r = audiorecorder(8000,16,1);
record(r);
stop(r);
I can't do what I want because the recording will stop immediately after it starts
Can anyone tell me how to solve this problem?

채택된 답변

Geoff Hayes
Geoff Hayes 2020년 6월 11일
Oai - from Record audio to audiorecorder object, you can specify the length of the audio recording as
r = audiorecorder(8000,16,1);
record(r, 10); % <---- where 10 is the number of seconds to record
  댓글 수: 1
Oai Vu
Oai Vu 2020년 6월 12일
That's exactly what I want. Thank you very much!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by