Read wave file
4 views (last 30 days)
Show older comments
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!!
0 Comments
Answers (1)
Daniel Shub
on 19 Feb 2012
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 Comments
Jan
on 22 Feb 2012
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.
See Also
Categories
Find more on Audio and Video Data in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!