record
Record audio to audiorecorder object.
📝Syntax
record(recorderObj)
record(recorderObj, length)
📥Input Arguments
Parameter Description
recorderObj audiorecorder object: audio recorder object created by audiorecorder.
length double: duration of recording in seconds.
📄Description

record(recorderObj) starts recording audio from an input device using the specified audiorecorder object.

record(recorderObj, length) records audio for the specified number of seconds.

The audiorecorder object defines the sample rate, bit depth, and other properties of the recording.

💡Examples
Record 5 seconds of your speech with a microphone
myVoice = audiorecorder;
myVoice.StartFcn = 'disp(''Start speaking.'')';
myVoice.StopFcn = 'disp(''End of recording.'')';
record(myVoice, 5);
play(myVoice);
      
🔗See Also
audiorecorderplayrecordblockingpauseresumestop
🕔Version History
Version Description
1.16.0 initial version
Edit this page on GitHub