ni.com checkout is currently experiencing issues.

Support teams are actively working on the resolution.

LabWindows/CVI User Group Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Save acquired data in WAV format using CVI

Hallo,

I'm a newcomer in the LabWindows/CVI group.

Currently I’m designing a data acquisition system based on PXI.

The project is already at an advanced stage and now I would like to add some more features at the system.

One of those is the capability to save the acquired data in a WAV format, in order to play the file using a multimedia player.

My acquired data are a single channel, 16 bit, 96 KHz sampling frequency.

Is there anyone who has a readymade CVI code that saves a 16 bits array to a WAV format file?

Thanks for your help

Gerardo

0 Kudos
Message 1 of 4
(5,115 Views)

Gerardo,

Welcome to the group.

I ran into this same problem some years ago. We couldn't find a way to save into an actual WAV format from CVI but we determined that all we needed to do was to build the appropriate header information to stick in front of our data and it worked just fine. Since it was working, I never felt the need to revisit it. I'll be interested to see if someone knows if this is a capability has been added to CVI since then. If not, I'll dig out the code we use for our brute force solution and post it for you.

Garry Owen

0 Kudos
Message 2 of 4
(3,344 Views)

Thanks Garry for your reply.

Unfortunately I haven't found yet the solution of my problem.

I would really appreciate if you could send me your "old code".

Gerardo Parisi

0 Kudos
Message 3 of 4
(3,344 Views)

Gerardo,

Well, I did say I hadn't revisited that code in some years. It seems my memory was a little off. I can create a "wav" file that I can play using the play function within CVI. This was the only way we ever use that. Unfortunately, Windows Media Player is not impressed with my wav format and will not play it. The funtions I am using to play the file can be found in one of the examples that comes with CVI (...\samples\sdk\audio\...).

I'll attach the function I use to build the wav file.

Garry Owen

0 Kudos
Message 4 of 4
(3,344 Views)