フィルターのクリア

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

3 ビュー (過去 30 日間)
ZHU z
ZHU z 2022 年 4 月 5 日
編集済み: ZHU z 2022 年 4 月 5 日
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 Center および File ExchangeAudio 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