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: est_AT_hyperreal.org
Date: ma elo    16 1999 - 08:31:16 EDT


Erik de Castro Lopo discourseth:
>
> > > 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.

Well, the assertions are compiled out during a normal library build,
but they include some tests that don't add appreciably to run-time and
that look important.

> > 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.

Clear design is a lot more important than test in this area.

> > 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.

A quick look at the code suggests that this remains partially true (it
looks like 32-bit integral has been added).

> 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

It may be both more important and easier to target the interface
provided by the one distributed with gnome.

> > 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)

Oh, *do* get the 3rd edition. I wasn't that interested in C++ until
the 3rd edition came out (I got the 2nd the same time you did :), the
standard matured, and egcs made it widely deliverable.

> 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.

Eh..on second thought it's probably a silly idea if you're not using
other C++ features. :) Basically, you'd be able to throw libsndfile in
a namespace of that name..no abbreviations needed because clients can
say `using namespace libsndfile;' or `using libsndfile::foo' if they
only wanted function foo.

> > 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 :-).

Hmm..maybe I'll need to rip resampling out of libsndfile! I'm working
as a total primitive here. First I did linear resampling. Then I did
quadratic, deriving it from first principles because I didn't have a
reference at hand. Are there better alternatives? Some kind of
spline thing perhaps?

Eric


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