필터 지우기
필터 지우기

About error"The function 'analoginput' is no longer supported. Use the session-based interface."

조회 수: 3 (최근 30일)
function [signal,Fs,Nbits,time,nfft]=Record(refreshRate)
%%This function records audio from the microphone and writes the audio into
%%a wav file in Record Mode.
% Developed by Gabriel Brais Martinez Silvosa
% September, 2013
%%Acquisition settings
sampleRate = 48000; % Hz
N=24; %N-bit/ sample
ai = analoginput('winsound');
addchannel(ai,1);
sampleRate = setverify(ai, 'SampleRate', sampleRate);
ai.TimerPeriod = refreshRate;
spt = ceil(sampleRate * refreshRate);
ai.SamplesPerTrigger = spt;
nfft=spt;
set(ai,'SamplesPerTrigger',nfft);
%%
% Start Acquisition %%
start(ai);
[data time] = getdata(ai);
%
%Record Acquisition
audiowrite(data,sampleRate,N,'16amship.wav');
%
[signal,Fs,Nbits]=audioread('16amship.wav');
delete(ai);
clear ai
hi all~
When I run matlab I get the error "The function 'analoginput' is no longer supported. Use the session-based interface"(line 13)
Does anyone know how to correct this code?
thanks a lot !

답변 (0개)

카테고리

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

제품


릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by