0
$\begingroup$

I seek a scaled audio file format for my dsp output.

I'd like to produce "scaled wav files", when I've done my pre processing. Eg. if the amplitude is 15.5 (of whatever unit), you should be able to open a standard wav/whatever file and see "15.5".

If you produce a normal 16 bit wav file, you have to tell the user, to scale all values with value xx.xx. This would be ok, if the scale factor could be included in the file, in a standardized fashion. But so far I haven't been able to find any "scale factor" field in the wav format?

Another way could be to produce a 32 bit float wav file. This could actually contain the value "15.5". Problem is that wav float values are defined to be in the range [ -1.0 : 1.0 ]. I've tried opening such a file in different freewares like eg. Audacity. But they don't take well to the larger scale. They still only display the [ -1.0 : 1.0 ]. Do you know a program that will display large scale float wav files?

(Btw I do realize that the "scaled audio" is not "audio" anymore.)

$\endgroup$
1
$\begingroup$

ID3v2 tags include RVAD (Relative Volume ADjustement), and two of the RVAD values are "Peak volume right" and "Peak volume left".

The problem is not fixed point versus floating point though. The two are pretty similar. You can treat the 16 bit fixed point as a integer (Q15.0), or as a x/32768 fraction (Q0.15) so the range is -1.0, +1.0 or as x/256 (Q7.8, -256,+256 range).

$\endgroup$
  • $\begingroup$ Yes, it seems like the peak value is a valid scale factor. However, according to this: id3.org/id3v2.4.0-changes it's deprecated. The replacement RVA2 also seems useful though. $\endgroup$ – Illishar Jan 3 '18 at 8:20
1
$\begingroup$

This link implies that .wav files have several standards for storing 32 bit floating point. It looks like foramt 32-bit 16.8 float (type 1 - 32-bit) would do what you want.

As best I can see, SOX (reference) can work (read it at least) with this type of format, so you could look at the source code to see how to generate/read these files. CoolEdit claims to be able read and write this format (see first link.)

$\endgroup$
  • $\begingroup$ It's interesting at least. However, I've looked through the references and the output. It turns out that the CEP 32-bit 16.8 float format is legacy and marked as obsolete. That doesn't matter so much, so I tried saving a file in the format. The 16.8 float format is actually a 32-bit PCM file. (A 32-bit integer.) And there's nothing that indicates (eg. extended subformat) that it should be interpreted as float or anything. In other words, it's a legacy bug. $\endgroup$ – Illishar Oct 14 '14 at 9:37
  • $\begingroup$ Btw, I'd vote your answer as 'useful', but I cannot seem to vote yet. $\endgroup$ – Illishar Oct 14 '14 at 9:38
  • $\begingroup$ How is SOX able to recognize it, I wonder ... $\endgroup$ – Illishar Oct 14 '14 at 9:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.