| On 1/4/04 3:21 PM, jpff@codemist.co.uk etched in stone:
> "right" library is the one that cause the least modifications to the
> system and provides all the facilities required.
Including working on all necessary platforms I would assume.
A couple of days ago, I was working on porting to Mac OS 9 a linux audio
program which happened to use libsndfile. I downloaded version 1.0.5 from
Erik's web site. There seems to have been support for OS 9 in the past but
the Mac read me was written for version 0.0.16. Much has changed since then
in the library including switching to using GNU autoconfig, etc. The Mac
config.h file was seriously out of date.
I did manage to get the library to compile after about half a dozen changes
to the source, but I have no idea if it works yet since there is an issue in
linking to the library I built.
I should be able to resolve this issue, but there is still a fairly heavy
use of non-ANSI-C Unix calls in the library from what I can tell. These are
"available" with CodeWarrior on Mac OS 9 but some of them may not behave
correctly. Again, testing will be necessary, but most of the issues can
_probably_ be resolved if libsndfile is chosen.
To help with the process of selecting a library, I have compiled below a
survey of possible choices that I am aware of.
libsndfile, by Erik de Castro Lopo, has these features:
* supports a very impressive list of sound file formats and encodings
* claims that others should be easy to implement
* very robust handling of endian issues
* on-the-fly conversion of samples to several data-types
* can automatically write PEAK chunks to AIFF and Wave files
* seems to have commands to set float normalization behavior
* can easily or automatically update file header as data is written
libsndfile limitations:
- difficult to write other custom chunks/binary data ?
SndLib, from Bill Schottstaedt and used in Snd and Common Lisp Music has the
following features:
* basic read and write of NeXT, AIFF, Wave, Ircam, and Raw sound files
* "low level" API for manipulating file headers and read/write binary
arrays
* basic support for audio hardware (playback and record)
* has a nice set of functions for "endian-aware" data-type conversions
* interfaces for C, Lisp, Scheme, Ruby, and Forth
SndLib limitations:
- choice of sample data representation seems to be statically
determined at compile time ??
- audio support and other features would be "extra baggage" ?
The "Audio File Library," developed by Michael Pruett, seems primarily aimed
at the Unix platform. It supports NeXT, AIFF, Wave, and Ircam (others?)
with several encodings. Lack of any information regarding compiling on
Windows, Mac, BeOS, etc, plus an impression that the library is still rather
young, make me think that this may not be a good choice.
PortSoundFile, a part of the PortMusic project directed by Ross Bencina and
Phil Burk, would be nice from the perspective of being the companion to
PortAudio and PortMidi. However, it does not seem to actually exist yet
(??).
John ff. mentioned Dobson's PortSF. Is this the same as PortSoundFile which
is part of PortMusic? No other links to a "PortSF" showed up in a google
search.
Apple's QuickTime is very well tested and fully functional but obviously
won't work except for the MacOS and Windows.
Summary of Operating System support:
Linux Unix Sun Irix NeXT Win DOS Mac9 MacX BeOS
libsndfile yes yes yes? yes? yes? yes no? yes? yes no?
sndlib yes yes yes yes ??? yes no? yes yes no
Audio File yes yes yes yes yes? no no no yes? no?
PortSF yes yes? yes? yes? ??? yes no? no? yes ???
QuickTime no no no no no yes no yes yes no
Summary of Licenses:
libsndfile LGPL
sndlib BSD-style
Audio File LGPL
PortSoundFile MIT-style(?)
QuickTime proprietary
I hope that this helps the discussion/decision!
Anthony Kozar
anthony.kozar@utoledo.edu |