Error while recording using audio recorder object
4 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Jan
2021-9-16
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Audio and Video Data 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!