Re: Things I would like to see

From: Richard Dobson (rwd@cableinet.co.uk)
Date: Sun Aug 29 1999 - 06:16:40 EDT


I am in the process of adding f/p file support to both Saolc and sfront.
To make it worthwhile, the output buffer needs to be changed to floats
(from shorts), and the function wavWriteFloatFrames() which I had
already included in my WIN32 version of Saolc (riffwav.c) can then write
the data to whatever sample format has been requested. This in turn
requires a commandline flag to identify the requested sample format. In
this instance I am thinking of just shorts, 24bit packed, and floats
(the latter should cause an AIFF file to be written as AIFF-C). This is
how I have implemented the CDP Multi-channel Toolkit, for example. My
thinking behind this is that in almost all cases the float format is the
highest precision, so can support lower precisions without loss.

The only format where this logic breaks down is 32bit integer, and I can
well imagine that a lot of dsp-based implementations may very well want
to use this format (audio data in the Creamware Pulsar is 32bit ints,
for example, though it is a one-cyle instruction to switch betweeen a
float word and an int). I have read a lot of comments from dsp people
who deprecate all float formats, and assert that 32bit int processing is
the business. All the bits are used, whereas in normalized floats, most
of the exponent is wasted space, most of the time.

However, I am not worrying about this too much for the output format, as
it is a moot point whether the current 24bit DAC's are that linear
beyond 20 bits anyway, unless they are helium-cooled to minimize quantum
fluctuations!

There are probably several cases where ~internal~ calculation can be
done in doubles (filter coefficients being the main target), so long as
the final output word is a float, for compliance with the standard.

Ideally, I would like to replace the explicit use of distinct structures
for AIFF and WAVE files with a generic one, so that support for other
file formats can be added in one place. Otherwise, we will eventually
have not only AIF_STRUCT and RIFFWAV_STRUCT, but SND_STRUCT, SDII_STRUCT
and even SDIF_STRUCT in time!

FWIW, Windows2000 and Windows98 Second Edition both support direct
playback of Type-3 f/p WAVE files using waveOut calls - the data is
automatically dithered down to whatever the hardware can support (24 and
32bit ints similarly). They did not have time to add this support to
DirectShow, but it is there for the float format of WAVE-EX.

Richard Dobson

Michael Gogins wrote:
>
> More changes I would like to make to sfront:
>
> A float WAV soundfile output option. For me this is virtually a necessity. I
> anticipate a world of DVD audio at 24 bits per sample / 96 KHz sampling
> rate. Without float samples then SAOL will inevitably sound a bit "cheesy"
> and will not be used for professional purposes.
>
> Related to this, I repeat, default double precision processing.
>

-- 
Test your DAW with my Soundcard Attrition Page!
http://wkweb5.cableinet.co.uk/rwd (LU: 23rd August 1999)
CDP: http://www.bath.ac.uk/~masjpf/CDP/CDP.htm (LU: 14th June 1999)



This archive was generated by hypermail 2b29 : Wed May 10 2000 - 12:15:30 EDT