Azzera filtri
Azzera filtri

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

3 visualizzazioni (ultimi 30 giorni)
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 !

Risposte (0)

Prodotti


Release

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by