how to see live plot of my voice ?

조회 수: 8 (최근 30일)
tomer polsky
tomer polsky 2018년 7월 26일
댓글: tomer polsky 2018년 7월 27일
hello I want to see live plot of my voice but i cant figure how to do it , I wachted real time audio topics but still cant figure how to do it .
this is my code :
clc;
clear all;
close all;
recorder = audiorecorder( 96000 ,24,1)
disp('Start speaking.')
recordblocking(recorder, 3);
disp('End of Recording.');
a=play(recorder)
myRecording = getaudiodata(recorder);
subplot(2,1,1)
title('regular plot')
plot(myRecording);
subplot(2,1,2)
title('FFT plot')
plot(1:1:288000,fft(myRecording));
but this code is not 'real time ' meaning that in this code i record my voice and then can only see the plot of my voice .

채택된 답변

Jason Whitfield
Jason Whitfield 2018년 7월 26일
As the name suggests, the recordblocking method will block the execution of the rest of the script until the recording finishes. If you don't want it to block, you can use the record method instead. Here is an example script that will plot 10 seconds of audio data in real time.
recorder = audiorecorder(96000, 24, 1);
disp('Start speaking.')
recorder.record(10);
while recorder.isrecording()
pause(0.1);
plot(recorder.getaudiodata());
drawnow();
end
disp('End of Recording.');
  댓글 수: 1
tomer polsky
tomer polsky 2018년 7월 27일
oh thank you very much my friend, now it seems logical to me .

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

추가 답변 (0개)

카테고리

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