Re: [linux-audio-dev] Re: Nicola Bernardini's sound file library comments

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

Subject: Re: [linux-audio-dev] Re: Nicola Bernardini's sound file library comments
From: Erik de Castro Lopo (erikd_AT_zip.com.au)
Date: ma elo    16 1999 - 05:06:25 EDT


est_AT_hyperreal.org wrote:
>
> Erik de Castro Lopo discourseth:
>
> OK, Bruce. :)

Hullo Bruce. You seem to pop up everywhere.

> > 3) libsndfile has more comprehensive error reporting
>
> That may be an area where it's superior to libaudiofile as well. Much
> of the error checking of the latter seems to be burried in assert()
> statements!

I agree completely. assert () has no place in a library. libsndfile
doesn't
use assert () and on error conditions should at worst return an error
value
and set an internal error variable so that a meaningful error string can
be retrieved latter. Anything worse than returning an error value is a
bug and I want to fix it :-).

> Is libsndfile reentrant?

I actually haven't tested this but it was designed to be reentrant. The
ONLY static data should be read-only string variables.

> What reasons are there for prefering it over libaudiofile given the
> momentum behind the latter?

I haven't really kept up with libaudiofile (or sndlib for that matter)
so I may be way off in my comments. Anyway, last time I looked
libaudiofile
did not handle any file format with data width greater than 16 bits.
This
means no 24 or 32 bit PCM data in WAV or AIFF files and no 32 bit
floating
point WAV file support. These formats are heavily used in during the CD
mastering process.

In addition, development on libaudiofile seems to be moving a bit more
slowly than libsndfile. Finally I think the interface to libsndfile is
more flexible due to the implementation of functions to read/write the
audio data as shorts, ints and doubles. Calls to these functions may
be intermixed with impunity.

At one stage I was talking to Richard Kent (author of DAP) about wruting
a wrapper around the libsndfile functions to emulate libaudiofile.
Unfortunately nothing can of it. I may still be willing if I can find
some
good documentation on SGI's version of libaudiofile

> > 1) An interface is designed to limit name space pollution. All libsndfile
> > functions are named sf_* and all constants are named SF_*
>
> You might want to have an option to build a C++ version which actually
> uses its own C++ namespace.

I'm not a great fan of C++ (and a bit behind the times, still using
version 2 of the Stroustrup book which was just out when I bought it)
but if you give me a bit of a rundown of what it is, how it works and
the implications, I'm more than willing to consider it.

> > 3) sample rate convert on read (ie open a file, see that it is not the
> > desired sample rate, call something like sf_set_samplerate (), then
> > read data at the correct sample rate using the normal read functions.
>
> Feel free to rip resampling out of oolaboola. :)

Thanks, I'll have a look. I'm very keen to get very high quality
resampling
going. I'm looking to get signal-to-noise ratios of 120dB to match
current
state of the art analog-to-digital and digital-to-analogue converter
technology. I'm not afraid to do some heavy maths and Octave is my
friend :-).

Cheers,
Erik

-- 
+-------------------------------------------------+
     Erik de Castro Lopo     erikd_AT_zip.com.au
+-------------------------------------------------+
"There are two ways of constructing a software design. One way is
 to make it so simple that there are obviously no deficiencies
 and the other is to make it so complicated that there are no
 obvious deficiencies."  --  C A R Hoare


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:25:52 EST