Error while recording using audio recorder object
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Everytime I work with this code, I'm getting errors like this.I'm not unable to rectify the problem and solve it.Could anybody please help?
How can I give the audiodata to ffname?
Error using audioread>readaudio (line 143)
The filename specified was not found in the MATLAB path.
Fs=8000;
ch=1;
nbits=16;
Nseconds=5;
recorder=audiorecorder(Fs,nbits,ch);
disp('Start speaking..')
recordblocking(recorder,Nseconds);
disp('End of Recording.');
record_file=getaudiodata(recorder);
ffname = sprintf('%s%s',record_file);
[st_dat,fs1] = audioread(ffname);
st_speech = resample(st_dat,fs,fs1);
st_y(1,:) = pyulear(st_speech,order,nfft,fs);
0 commentaires
Réponse acceptée
Jan
le 16 Sep 2021
record_file=getaudiodata(recorder);
ffname = sprintf('%s%s',record_file);
getaudiodata replies a numerical array with the signal. The name with the part "file" is missleading. Then you try to convert this array to a string using %s%s as format. Afterwards you try to use this string as a file name, but of course there is no such file.
Why do you try a read a file at all, if you do have the signal already?
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Audio and Video Data dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!