Interested in recording(thu USB) and plotting of speech signal in app designer.

조회 수: 4 (최근 30일)
Kulbir
Kulbir 2023년 3월 2일
댓글: Kulbir 2023년 3월 24일
Hello , i need to know how i can record my speech/voice and plot it at the same time in app designer. Also need to know how to implement LPF/butterworth. Thank you

답변 (1개)

Nikhilesh
Nikhilesh 2023년 3월 3일
I hope the following steps can guide you.
  1. Add an audioRecorder object to your App Designer app. You can do this by adding a button or other UI component that calls a callback function when pressed. In this function, create an audioRecorder object using the audiorecorder function, and set the sample rate and number of channels.
  2. Add a loop to continuously read and process audio data. In this loop, use the record method of the audioRecorder object to record a fixed length of audio data (e.g., 0.1 seconds). Then, use the getaudiodata (Store recorded audio signal in numeric array - MATLAB getaudiodata (mathworks.com)) method to retrieve the recorded data as a vector of samples. You can then use this data to compute the spectrum or other characteristics of the audio signal.
  3. Plot the audio data in real-time. You can use the plot function to create a line plot of the audio data, and update this plot each time a new chunk of data is recorded.
  댓글 수: 2
Kulbir
Kulbir 2023년 3월 21일
Hi sir. i am trying to follow your way of designing app designer. will reach you if i need. thank you
Kulbir
Kulbir 2023년 3월 24일
Hi there, i have tried to add audiorecorder. but it's not working. At the beginning, i would like to record , play and save the sound. kindly help me out. thx
%FOR RECORDING
Fs = 44100;
nBits = 16;
nChannels = 2;
ID = -1; % default audio input device
app.recObject = audiorecorder(Fs,nBits,nChannels,ID);
msgbox("Begin speaking.")
recDuration = 5; % record for 5 seconds
recordblocking(app.recObject,recDuration);
msgbox("End of recording.")
assignin('base','audioObject',42);
%PLAY
audioObject= evalin('base','audioObject');
y= getaudiodata(audioObject);%Undefined function 'getaudiodata' for input arguments of type 'double'.
Fs= audioObject.SampleRate;
sound(y,Fs);
%SAVE
file1= 'sound.wav';
audiowrite(file1,y,Fs)
%play(audioObject)

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by