Wave file format metadata extension

Hello everyone.

I’m working on an application to measure frequency vs. impedance of speakers.

In my code, I make a test signal that is a stepped sine wave sweep from F1 to F2 in n steps per octave. Then I use Audacity to play the wave out and record from line in simultaneously. I have a simple op-amp circuit that puts the speaker in the negative feedback loop of the op-amp, so that the gain is proportional to the impedance of the speaker. My test signal gets put into this configuration and the output of it is recorded as a new wave. I then examine the resulting recording to find the peak value of each stepped frequency and I have it!

I would like to store information in the wave file such as the device name that I am measuring, ie; source, a woofer model or a reference resistor, the F1, F2 and steps per octave and the number of samples in each freq step.

I want something that will not be erased when I import or export waves from Audacity, so I though I could use the comment tag in the metadata editor.

I would like to know the format of the added metadata section to the wave file spec so that I can read it and write it in my own code (C++).

Thanks!

I’d suggest that you use FLAC format, as it has much better support for metadata than WAV.
More info: https://wiki.xiph.org/Metadata

I would like to know the format of the added metadata section to the wave file spec so that I can read it and write it in my own code (C++).

I’ve never see the spec for metadata in a WAV file but you can write some metadata with Audacity and then look at the file with a hex editor (which I assume you have).

…I have looked at [u]WAV file headers[/u] with a hex editor.

I have a simple op-amp circuit that puts the speaker in the negative feedback loop of the op-amp…

It looks like you’re about done with your project but have you seen [u]Dayton Audio DATS V3 Computer Based Speaker & Audio Component Test System[/u]?

Thank you for the replies.

I want to use wave because I have already written a nice set of classes and functions in C++ to deal with them. I have added some metadata to a wave in Audacity and looked at it in a hex editor. I just want to make sure I get it right. I want to know the proper section header and offset pointer and all that stuff that makes it a legal chunk in a chunk file format. I also want to know that I am not reading past the “data” chunk and into the last chunk. It seems like the metadata is added to the very end of the file.

Apparently, Audacity knows about some version of ID3. If I knew for sure which one, that would be helpful.

I am aware of the DATS 3.

I actually wrote the core of my code back in 1998 and I just wanted to update it and put it out as open source. I want to keep it generic and very simple to use so that anyone can use it in any OS. The fact that Audacity can do simultaneous play and record is great! All I need to do in my code is deal with file io.

I also have a nice C struct and a bunch of functions for managing bitmaps in file and memory. So I can create all the graphs of the results.

I suppose I could put all the data I need in the name of the file. That’s pretty easy to do.

James.

For WAV files, Audacity exports metadata in a RIFF INFO chunk for all seven default tags plus “Copyright” and “Software”. It also exports all the entered tags as ID3 tags.
Ref: https://exiftool.org/TagNames/RIFF.html#Info
Ref: https://en.wikipedia.org/wiki/ID3