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

recordblocking(recorderObj, length) records audio from an input device for the specified number of seconds. This method does not return control until recording completes.

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, and play it back
myVoice = audiorecorder;
disp('Start speaking.');
recordblocking(myVoice, 5);
disp('End of recording. Playing back ...');
play(myVoice);
      
🔗See Also
audiorecorderplayrecordblockingpauseresumestop
🕔Version History
Version Description
1.16.0 initial version
Edit this page on GitHub