06-12-2009 11:47 AM
Solved! Go to Solution.
06-12-2009 12:40 PM
If 24 bit is used a -2 is used. If 16 bit is used the expected 1 is to be found. Could it be that matlab do not handle 24 bit?
06-12-2009 01:35 PM
06-12-2009 02:04 PM
06-12-2009 02:59 PM
06-12-2009 03:48 PM - edited 06-12-2009 03:49 PM
cb3 wrote:
What is the sorce of your wav format documentation?
Sad to say not good. I quick and dirty Goggled it. I did not get any smarter. But I did not put so much effort into it. 😉 But it is a reason for that the FEFF is put in. At the same time I came to the same conclusion as you. And so do Matlab. Take a look here
06-16-2009 04:34 PM
Well, I've learned quite a bit more since last we communicated. The standard MatLab wav reader is wavread.m. This script should be able to read multi channel 24 bit files; but it doesn't read the files from LabVIEW. We've located a modification to this script called wavexread.m which was developed to read wav files that use WAVE_FORMAT_EXTENSIBLE. This format was developed by MS as an extended format to write multi channel 24+ bit files with other included information. The LabVIEW wav files are readable by MatLab via use of this script. Essentially the script ignores the formatting as though the compression setting for the PCM format was set to 1 (instead of -2 or as we know it, "FEFF"). I did try re-writing the binary wav file and replaced the "FEFF" with "0100". This file was readable by the stock wavread.m but not the extended wavexread.m; further hiliting the fact that MatLab really shouldn't care.
However, I will throw this back to NI to ask whether it is really necessary to use the extended format to write these files when the standard format would sufice. It sure would have made life much simpler if my customer hadn't needed to worry about this.
Thanks for you help.
11-16-2010 01:30 PM
Dear
I am facing the same problem. but I didn't understand how to fix it.
Should I use the wavexread.m in the Matlab ? and if yes, where can i find this script or function (as I searched for it but I couldn't locate it)
or Should I make these transformation from 0xFEFF to 0x0100 ? and also if yes, how can i make it?
Many thanks,
Marc
11-16-2010 02:59 PM
I've attached the MATLAB scrit, wavexread.m. Just remove the suffix, .txt.
You can also find it at http://www.playrec.co.uk/download/wavexread.m
Good luck.
11-18-2010 08:35 AM
Many thanks for your reply and sending me the .m file
But unfortunately, it does not work, it says:"incorrect chunk size information in wave file".
Do you know what should I do ?!