Error while recording using audio recorder object
3 ビュー (過去 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!