record audio and get data in real time
이전 댓글 표시
Hello, i want to make a recorder in real time, and i get data every 0.01 second with recording parameters(Fs = 8000, nbits = 16 bits, nbChannel = 1), so i want to get the 80 samples (every 0.01) second to analyse them and apply my work. i used audiorecorder object but no result, when i try to get data it is empty. Thank you
댓글 수: 2
Geoff Hayes
2016년 5월 27일
dz - please show the code that you have written to use the audio player. Have you created a GUI to start the recording and display the results in real-time? Provide some context as to what you are attempting.
Geoff Hayes
2016년 5월 28일
dz's answer moved here
clear all
clc
close all
global dt dtt c
%%Create a timer object:
time_rec = 2;
recObj = audiorecorder(8000,16,1);
set(recObj,'TimerPeriod',0.01,'TimerFcn',@VADML);
record(recObj,time_rec)
%%below function is to try to read data by samples for each 0.01 sec
function [dt] = VADML(h,~)
global dt dtt c
% Get data from each sample
dt = getaudiodata(h)
% compute energy
c=0;
if mod(length(dt),80)==0
c=c+1
dtt=dt(1:80)
end
end
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Audio and Video Data에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!