필터 지우기
필터 지우기

How to get partial data from audiorecorder

조회 수: 1 (최근 30일)
Danil Voloshko
Danil Voloshko 2016년 2월 12일
댓글: Walter Roberson 2017년 9월 19일
Hi.
I want to plot my speech in realtime. now i using this code
clc; clear all; close all;
fs=14000;
l=10;
recObj = audiorecorder(fs,16,1,1);
%recObj.UserData=1;
recObj.TimerFcn = {@my_callback_fcn};
disp('Start speaking.')
recordblocking(recObj, l);
disp('End of Recording.');
y = getaudiodata(recObj);
play(recObj);
x=0:1/fs:l-1/fs;
plot(x,y);
and callback function
function my_callback_fcn(obj,event)
y = getaudiodata(obj);
plot(y);
hold on;
obj.UserData=obj.TotalSamples;
end
In this case my script begins to lag after 3-4 secs of work. How can i solve that problem? I tried to find find some fields in
recobj
that contain original data, but seems like it doesnt. So how can i atleast get partial data from recObj(planing to use plot and hold on)?

채택된 답변

Walter Roberson
Walter Roberson 2016년 2월 12일
audiorecorder is not designed for real-time work. You should look at the DSP System Toolbox, which has ability to use ASIO drivers for low-latency work.
  댓글 수: 2
Derrick Ling
Derrick Ling 2017년 9월 19일
Is this answer still valid? from this website, it states audio system toolbox is capable of doing real-time signal processing
Walter Roberson
Walter Roberson 2017년 9월 19일
That toolbox did not exist at the time that answer was written. Probably you could use either toolbox now

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

추가 답변 (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