Store recorded audio signal in numeric array
y = getaudiodata(recorder)
y = getaudiodata(recorder, dataType)
y = getaudiodata(recorder) returns recorded audio data associated with audiorecorder object recorder to double array y.
y = getaudiodata(recorder, dataType) converts the signal data to the specified data type: 'double', 'single', 'int16', 'int8', or 'uint8'.
Audio signal data y contains the same number of columns as the number of channels in the recording: one for mono, two for stereo. The range of values depends on the data type, as shown in the following table.
Collect a sample of your speech with a microphone, and plot the signal data:
% Record your voice for 5 seconds. recObj = audiorecorder; disp('Start speaking.') recordblocking(recObj, 5); disp('End of Recording.'); % Play back the recording. play(recObj); % Store data in double-precision array. myRecording = getaudiodata(recObj); % Plot the waveform. plot(myRecording);