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 Center および File ExchangeAudio and Video Data についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by