From alsa-devel-owner@alsa.jcu.cz  Tue Jan 19 17:28:29 1999
Received: from fortress.fnc.fujitsu.com (fortress.fnc.fujitsu.com [204.253.82.1])
	by marvin.jcu.cz (8.9.1a/8.9.1) with ESMTP id RAA30657
	for <alsa-devel@alsa.jcu.cz>; Tue, 19 Jan 1999 17:26:01 +0100
Received: from tddeng00.fnts.com (tddtx.fujitsu.com [167.254.254.99]) by fortress.fnc.fujitsu.com (8.8.7/FNC/ITG-2.0.1) with SMTP id KAA01631; Tue, 19 Jan 1999 10:24:37 -0600 (CST)
Received: from tddtx.fujitsu.com by tddeng00.fnts.com (SMI-8.6/SMI-SVR4)
	id KAA01703; Tue, 19 Jan 1999 10:25:00 -0600
Message-ID: <36A4B1DD.8B9324DB@tddtx.fujitsu.com>
Date: Tue, 19 Jan 1999 10:25:01 -0600
From: Chris Bagwell <cbagwell@tddtx.fujitsu.com>
MIME-Version: 1.0
To: Jaroslav Kysela <perex@jcu.cz>
CC: Jimen Ching <jching@flex.com>, alsa-devel@alsa.jcu.cz
Subject: Re: alsa-lib
References: <Pine.LNX.3.96.990119115220.25743S-100000@entry.jcu.cz>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list

Jaroslav Kysela wrote:
> 
> On Mon, 18 Jan 1999, Jimen Ching wrote:
> 
> > Hi all,
> >
> > I've just finished reading the alsa-lib documentation.  I see that the
> > library has support for a few sound file formats.  I am in the process of
> > adding alsa support into sox, and noticed that sox has its own library.
> > Sox's library supports a lot more file formats and quite a few sound
> > functions, i.e. echo, vibro, etc.  I'm wondering if it would be a good
> > idea to merge the library somehow.  It seems to be a duplication of effort
> > if we end up with two libraries that does the same thing.
> >
> > Note, the library I'm talking about is just the file format and sound
> > effect support.  alsa-lib and sox would end up being front-ends or
> > wrappers around this lower-level library.  The benefit of this is that, we
> > have a library API which is cross-platform, and alsa-lib would gain all of
> > the file formats already in the sox library.
> >
> > What do people think about this?
> 
> I think that better way than should be design some universal PCM plug-in
> interface for effects and maybe for verious file formats. Effects should
> be placed to separate modules to some good place like
> 
>         /usr/libexec/alsa/pcm-effect/reverb.so
>         /usr/libexec/alsa/pcm-format/wave.so
> 
> etc..
> 
>                                                         Jaroslav

Yes, what you described is what SOX does.  Its just a bunch of file
handlers that know how to convert a given file format to or from PCM
data.  That way you can grab a handler for WAV files and use its
convert-to-PCM functions.  Then grab an AIFF handler and use its
convert-from-PCM to create an AIFF file.

The same is true for effects.  Simplifies writing code a lot although
there is a performance and data precision issue (you'll lose precision
when converting from u-law to PCM back to u-law).

SOX has already done the hard work in knowing how to process the data
but it has a very aging framework.  If you guys can use it the codes
there for the taking.

Chris

