recordblocking

Record audio to audiorecorder object; hold control until recording completes.

📝 Syntax

  • recordblocking(recorderObj, length)

📥 Input argument

  • 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.

💡 Example

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

audiorecorder, play, recordblocking, pausearrow-up-right, resume, stop.

🕔 History

Version
📄 Description

1.16.0

initial version

Last updated

Was this helpful?