Read wave file
이전 댓글 표시
I am trying to read a wave file in matlab using the following code:
hfile = 'w1.wav';
clear y Fs
% Read the data back into MATLAB, and listen to audio.
[y, Fs, nbits, readinfo] = wavread(hfile);
y,Fs,nbits,readinfo;
sound (y, Fs);
But I get this error:
Warning: File contains uninterpretable data.
> In importdata at 144
In uiimport>runImportdata at 437
In uiimport>gatherFilePreviewData at 380
In uiimport at 210
In open at 159
In uiopen at 196
Could anyone please tell me how to get rid of it as I am unable to read the wave file and get any output.
Thank you very much!!
답변 (1개)
Daniel Shub
2012년 2월 19일
Based on the error you provided, I am guessing something else is going on. The error never refers to wavread. Further, I don't see how the wavread function could ever call uiopen. Have you redefined wavread?
What do you get with
which -all wavread
댓글 수: 3
olivia
2012년 2월 22일
olivia
2012년 2월 22일
Jan
2012년 2월 22일
Sorry, Olivia, I cannot follow you. Audio files cannot run in a command prompt at all, independent on the number of bits. Audio files are only data files. So please post a copy of the command, which run or don't run and explain, what you mean by "64 bit PC command prompt".
How did you check it "in the properties", if the file is a wav file? do you mean the file properties shown by the Windows Explorer? If so, I assume its opinion is based on the file extension only... Please open the file using the MediaPlayer or any other sound program and try to play it there.
카테고리
도움말 센터 및 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!