LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading wav file about value over -1 ~ 1

I'm having trouble to read wav file.

When I read wav file, a value less than -1 or greater than 1 will be -1.

original wav data

wav crop.png

attached wave file, vi

Best regards

 

Download All
0 Kudos
Message 1 of 5
(3,319 Views)

Hi ijerom,

 

I'm having trouble to read wav file.

What kind of trouble? There is no trouble: LabvIEW doesn't return any errors…

 

When I read wav file, a value less than -1 or greater than 1 will be -1.

Because all the data in the wave file are limited to values between ±1.

As can be easily checked using Audacity (or any other tool)…

 

Your wave file contains 5 channels, uses a samplerate of 25.6kHz - and all channels are limited to a range of ±1.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(3,305 Views)

and all channels are limited to a range of ±1.

That is trouble. ;;

 

If you have matlab program, you can use the audioread() function to see that the value is truncated.

You can see from the attached picture. 

That has read the same file.

 

Thank you reply.

0 Kudos
Message 3 of 5
(3,291 Views)

The file you sent does not appear to be a standard .wav file.  (Standard .wav files are digital; the file data appears to have fractional values.)  More importantly, the graph of the supposed .wav file looks nothing like the "original" .wav file.  Something is drastically wrong with this picture, and it's not remotely related to LabVIEW...

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 5
(3,277 Views)

By default Audacity shows each of the channels on a -1..+1 scale which makes them look like they clip, but if you use the amplify function to attenuate the signals, it's clear that the original data isn't clipped to that range and actually goes beyond it, just like in the graph in the original post. I'm not very familiar with how floating point WAV files are usually done, whether it's expected that the data won't exceed that range; maybe the LabVIEW sound data read function assumes it won't go outside of that range and can't handle values beyond it properly.

0 Kudos
Message 5 of 5
(3,257 Views)