04-21-2023 09:56 PM
04-22-2023 10:05 AM
About a decade ago, I was briefly involved with a project to analyze animal calls recorded as .wav files. I remember looking up the specifications for these files, and building a parser for the "simple stuff", but the project was dropped by my colleague before I got too involved. You might try a search for "Wave File Format", which is the name of the HTML document I still have ... You might also try looking in the LabVIEW Tools Network (VIPM) to see if there are any Wave "readers".
Bob Schor
04-23-2023 01:35 AM
04-23-2023 01:37 AM
Thanks. In VI package management, i saw "open sound control" package, but not sure whether it can parse the wav file.
04-23-2023 03:49 AM
Hi Brzhou,
@Brzhou wrote:
not sure whether it can parse the wav file.
Your problem can be divided into two sup-problems:
Suggestions:
Please explain what you have tried and where you are stuck.
Please show your current VI(s)/project.
(We will not do your homework for free, so please show some effort on your own.)
04-23-2023 04:07 AM
Hi GerdW,
Thanks for your info, I will try it.
04-23-2023 09:13 AM
I also need to thank @GerdW -- I (foolishly) didn't look carefully at the Sound VIs, and, sure enough, there is a Files section that has "Simple Read" and "Simple Write" that know how to read and write .wav files! It even comes with an Example that you can use to get started exploring what (simple) things you can do with these files. [The reason I said "simple" is this treats the data in the .wav file as a simple stream of (usually 2) channels of sampled analog data (I believe 16 bit, but I'll check on this, without explicitly returning all the encoded data that is part of the .wav specification].
I've looked at the Example, which is pretty "bare-bones". I'm going to play with it a bit, and plan to explore some ideas about how to extract the waveforms from, say, the 2-channel sound example presented and how you might start to analyze the data in those signals. Stay tuned ...
Bob Schor
04-23-2023 09:44 AM
Thanks for your help Bob and GerdW.
The wav file is like this in "“Audacity", it is mono MEMS microphone:
I try to read via Labview, but report error, not sure what is wrong, thanks.
04-23-2023 10:50 AM
Hi Brzhou,
@Brzhou wrote:
The wav file is like this in "“Audacity", it is mono MEMS microphone:
I try to read via Labview, but report error, not sure what is wrong, thanks.
Unfortunately you don't attach your WAV file and unfortunately that Audacity image is scaled too small to be readable.
The error message is quite clear: unsupported file format. But again we cannot check the file format because yoou don't provide (readable) information…
04-23-2023 10:58 AM
OK, now we are getting somewhere (on two different paths).
First, here is how you read a .wav file that represents ordinary stereo sound waveforms, such as from a music CD, where you have two channel analog samples taken at 44.1 kHz. This is a derivative of one of the examples that ships with LabVIEW, after I tested it and added some additional processing to show such things as the sampling frequency. I'm attaching this as a Project file (with the sound sample embedded in a \Data subfolder of the Project), and also posting a Snippet (which will probably not work, as it won't have the data file handy).
This works, actually. I should mention that the "Play Waveform" function you see here is the Icon view of the Play Waveform Express VI that you'll find in the Sound Files sub-Pallet -- I prefer Icon views as the Error Line appears in the right position and the Inputs and Outputs are better organized.
Did you ever attach the .wav file from your "mono MEMS microphone" for us to examine? According to the "pictures" (I really dislike "pictures" in the Forum -- it "teases" those of us who want to help, but who don't get information in a form we can see, can study, can edit, can play with ...) you just attached, it appears that it might be a digital output that might need to be further "decoded" to become a conventional audio signal capable of being "heard" by our "analog" ears.
In any case, please attach the .wav file itself that you are trying to read. If it is too large for the Forum, see if you can compress it and attach it as a .zip file.
Bob Schor