Cannot Use Sound VIs With .WAV Files Larger Than 2 GB in LabVIEW

Updated Mar 17, 2023

Reported In

Software

  • LabVIEW

Issue Details

I am using the Sound Files VIs located under the Graphics & Sound >>> Sound >>> Files palette but I am having issues writing or reading .wav files larger than 2 GB. For example, when writing a .wav file with a size over 2 GB it errors out reading it in third-party software. Is there some sort of size limitation regarding the .wav files that can be read/written using the Sound VIs?

Solution

The Sound Files VIs are limited to writing or reading files under 2 GB of size because it calls a DLL that uses int32 as input. 2 GB is a common limitation for any API that uses int32s because the max number representable by a signed 32-bit value is 2,147,483,647. WAV files themselves have a hard limit of 4GB because the header contains an unsigned 32-bit file size field. Please limit the size of the .wav files being read or written to a size of 2 GB to avoid this issue. 

Additional Information

If the file size is between 2GB and 4GB, it may be possible to turn on the high bit in this size field and make other programs able to use the file.