Re: [linux-audio-dev] libsndfile (was Sample conversion tools)

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

Subject: Re: [linux-audio-dev] libsndfile (was Sample conversion tools)
From: Josh Green (jgreen_AT_users.sourceforge.net)
Date: Tue Jun 04 2002 - 12:09:47 EEST


On Tue, 2002-06-04 at 02:45, Erik de Castro Lopo wrote:
>
> On 04 Jun 2002 01:04:55 -0600
> Josh Green <jgreen_AT_users.sourceforge.net> wrote:
>
> > Does libsndfile have sample conversion routines yet? That is the one
> > thing I like about libaudiofile. You can set a virtual format and this
> > would be converted to/from when loading/saving samples.
>
> What exactly do you mean by this? libsndfile allows you to open a 16 bit
> PCM WAV file and read the data as short, int, float or double depending
> on whether you call
>
> sf_read_short()
> sf_read_int()
> sf_read_float() or
> sf_read_double()
>
> If you open a file for writing and specify that the destination file be
> 16 bit PCM data you can use any of the sf_write_XXXX functions.
>
> Scaling and endian conversion etc takes place automatically on the fly.
>
> This has been a feature of libsndfile since the very first released version.
>

Wow, I was not aware of that. I thought that "sf_read_short" should only
be called for 16 bit audio, sf_read_int for 24 bit, etc. Perhaps I
should read the manual again to see how obvious this feature of
libsndfile is in the docs. Not sure how I missed this point, but it sure
makes things a lot easier! That was really the only thing I thought
better about libaudiofile, now I don't see any particular advantage to
it. I'll be sure to write a plugin for libsndfile for Swami soon.

> > This is currently handled (at least for SoundFonts) with libsoundfont. I
> > would like to extend this to DLS though, without attempting to unify the
> > API.
>
> This is indeed a noble goal.
>
> Erik
> -

:) Cheers.
        Josh Green


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

This archive was generated by hypermail 2b28 : Tue Jun 04 2002 - 12:11:50 EEST