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!