Effacer les filtres
Effacer les filtres

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

3 vues (au cours des 30 derniers jours)
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 !

Réponses (0)

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Produits


Version

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by