I assume that what you want to do is add documentation into the header of the wav file such as the media type, location, equipment used .....
Some one may have written some routines to do this in Labview, unfortunately all the ones I have are written in Visual Basic, quite a long time ago.
Here are some pointers in the event that no one has any Labview stuff, we could even knock a few togther, if its not been done.
The WAV file falls into a cateory of Windows files known as RIFF format files, in fact you will see this written into the file header almost at the very front.
I quote here from the Microsoft Technet Article:-
See
here for a nice picture and
here for full details, although for the header structure I prefer
here.
"
The basic building block of a RIFF file is a chunk. A chunk is
a logical unit of multimedia data, such as a single frame in a video
clip. Each chunk contains the following fields:
- A four-character code specifying the chunk identifier
- A doubleword value specifying the size of the data member in the chunk
- A data field
"
Don't be put off by the fact that it often says AVI rather than WAV in the examples, the RIFF format is an extensible file format supporting lots of various media types even custom types. It's just that at the moment people are interested in Video.
There are standard fourcc codes that exist to hold various specific types of information and if one of these is not suitable you can create your own, there is (well was) even a way to regiser your own special type with Microsoft!!
There are a couple of ways of doing the job (assuming some kind sole does not donate a VI library).
1) Handle all the file i/o yourself by reading in the file and then insert the appropriate headers and rewrite the file out again.
Involved, but cross platform.
2) Muck about with Windows 'mmio' librarys (
mmioCreateChunk).
Platform specific but possibly more reliable???
If you select option 1, then what you have to do is read in the appropriate chunk sizes(lengths) contained in the header, insert your appropriate FOURCC code, size(length) and data then adjust the affected 'chunk' size indicators to put all the various size indicators in the correct place, simple ehhh
If you select
option 2, this requires linking to the appropriate DLL, it always my last resort to avoid DLL hell and portability issues.
As an example I wrote my own Turbo Pascal and later Visual Basic handlers which allowed attachment of lots of information from a form, and then created a special media format for the data to allow storing native measured data. These files are still recognised by WAV file readers today such as Media Player 10. Of course the data format is not understood because the encoding type was special, but that's the point.
One final point, there was a tool which read in a WAV file displaying all available headers, with C source (Windows 3.X) supplied in the MSDN toolkit. There are probalby other tools available by now, as a last resort If you decide to have a go I can send you my VB alpha version which reads all standard headers, it might write out a few as well (it was a very long time ago).
Good luck.
Message Edité par Conseils le 12-10-2005 04:09 PM