Re: [linux-audio-dev] sndlib remarks

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] sndlib remarks
From: Erik de Castro Lopo (erikd_AT_zip.com.au)
Date: ma loka   11 1999 - 16:38:00 EDT


Paul Barton-Davis wrote:
>
> i just want to follow up on my comments about sndlib, which sounded
> somewhat depracating.
>
> sndlib is great! sndlib's author realized that the difference between
> file formats can be split in two: the header type, and the data
> type. instead of having a bunch of code to handle RIFF files, and
> another to handle AIFF, Bill wrote stuff to read RIFF headers and AIFF
> headers, and then "added" stuff to read little endian 16 bit samples
> and big endian 16 bit samples, for example. thus, an AIFF file with
> the data stored a LE16 samples can be handled easily, as can an AIFF
> file with float32 samples, etc. This is easy because the header and
> data formats have been separated from one another.
>
> this is an excellent design - as far as I understand it, neither the
> SGI or Michael Pruett implementations of libaudiofile do this, and I
> don't know of any other similar libraries that take this approach
> either.

My libsndfile does it this way as well. All the functions to read
LE16, BE16, signed char, unsigned char etc are generic. When the header
parsing code figures out what the file type is if stores a function
pointer to the correct reading/writing functions in its private data
section and the correct functions are then called viw this pointer.

Just in case anybody has forgotten :

    http://www.zip.com.au/~erikd/libsndfile/

Erik

-- 
+-------------------------------------------------+
     Erik de Castro Lopo     erikd_AT_zip.com.au
+-------------------------------------------------+
"Testing can prove the presence of bugs, but never their absence."
  -- Edsger Dijkstra


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : pe maalis 10 2000 - 07:27:13 EST