This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Record audio to audiorecorder object, holding control until recording completes


recordblocking(recorderObj, length)


recordblocking(recorderObj, length) records audio from an input device, such as a microphone connected to your system, for the number of seconds specified by length. The recordblocking method does not return control until recording completes. recorderObj is an audiorecorder object that defines the sample rate, bit depth, and other properties of the recording.


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 ...');

Was this topic helpful?