Tuesday, October 6, 2020

RECORDING AND RETRIEVING AUDIO SIGNAL




 % SURAJ BASTOLA %%%%%%%%%%%%

%%%  RECORDING AND SAVING RECORDED AUDIO %%%%%%


% =======================Recording Audio and Saving it to some location================

audio = audiorecorder(8000,8,1); % y = audiorecorder(Fs,nbits,channels) 

fprintf('start speaking\n')


%%%% Stopping record after 10 seconds %%%%%%%%

recordblocking(audio,10); % recordblocking(recorderObj, length)

fprintf('End of recording\n')


%%%%% Getting data from audiorecorder Object and saving it to specified folder location %%%%%%%%%%%

myrec= getaudiodata(audio); % y = getaudiodata(recorder)

audiowrite('C:\Users\suraj\OneDrive\Documents\MIT COLLEGE\Software Defined Radio Communication\MATLAB COding\audioRecorded.wav', myrec, 8000);

fprintf('successfully saved the recorded audio');


% ========================Loading recorded audio by retrieving from saved location ===================

[y,Fs] = audioread('C:\Users\suraj\OneDrive\Documents\MIT COLLEGE\Software Defined Radio Communication\MATLAB COding\audioRecorded.wav');

sound(y,8000); % Playing retrieved audio

fprintf('successfully played the retrieved recorded audio\n')


% ===== Plotting the audio %%%%%%%%%%%

plot(y)

title('Recorded Audio of 10 seconds')



No comments:

Post a Comment

CHECKING WHETHER THE SYSTEM IS STABLE OR NOT

  % SURAJ BASTOLA % % ==========CHECKING WHETHER SYSTEM IS STABLE OR NOT ================== % H(z) = (2z+0.5)/(z^2+0.5z-1) b = [2 0.5]; a=[1...