From alsa-devel-owner@alsa.jcu.cz  Wed Jan 20 11:27:54 1999
Received: from entry.jcu.cz (IDENT:perex@entry.jcu.cz [160.217.1.111])
	by marvin.jcu.cz (8.9.1a/8.9.1) with SMTP id LAA07307;
	Wed, 20 Jan 1999 11:27:33 +0100
Date: Wed, 20 Jan 1999 11:27:33 +0100 (CET)
From: Jaroslav Kysela <perex@jcu.cz>
To: Elliot Lee <sopwith@redhat.com>
cc: alsa-devel@alsa.jcu.cz
Subject: Re: hi-res pcm sound support
In-Reply-To: <Pine.LNX.4.04.9901191512160.10458-100000@lacrosse.redhat.com>
Message-ID: <Pine.LNX.3.96.990120112410.26780D-100000@entry.jcu.cz>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list

On Tue, 19 Jan 1999, Elliot Lee wrote:

> On Tue, 19 Jan 1999, Jaroslav Kysela wrote:
> 
> > > Does the ALSA architecture have room for higher resolution (e.g. 24-bit
> > > 96Khz) PCM sound recording and playback? The asound.h that I looked at
> > > only said anything about 8 and 16-bit sound.
> > > 
> > > It would be really nice if someone with a professional audio background
> > > would ensure that ALSA has everything needed for pro sound production.
> > 
> > It is possible enhance API for more than 16-bit resolution, but as I asked
> > before (without any answer yet): How are 16+-bit samples encoded to
> > stream? How bytesex is used (one or both)?
> 
> The endianness that sound cards expect and samples use varies, but other
> than that it would seem that 24-bit numbers follow the same endianness
> rules as 16-bit numbers, you just need three bytes instead of two...?
> 
> The .wav file standard (available at http://www.wotsit.org/) says:
> 
> Because most CPU's read and write operations deal with 8-bit bytes, it was
> decided that a sample point should be rounded up to a size which is a
> multiple of 8 when stored in a WAVE. This makes the WAVE easier to read
> into memory. If your ADC produces a sample point from 1 to 8 bits wide, a
> sample point should be stored in a WAVE as an 8-bit byte (ie, unsigned
> char). If your ADC produces a sample point from 9 to 16 bits wide, a
> sample point should be stored in a WAVE as a 16-bit word (ie, signed
> short). If your ADC produces a sample point from 17 to 24 bits wide, a
> sample point should be stored in a WAVE as three bytes. If your ADC
> produces a sample point from 25 to 32 bits wide, a sample point should be
> stored in a WAVE as a 32-bit doubleword (ie, signed long). Etc.
> 
> And since WAVE samples are stored little-endian, the 24-bit number would
> be stored as such.

OK, I added all four types for 24-bit format to header and source, too. 

							Jaroslav

-----
Jaroslav Kysela <perex@jcu.cz>
Academic Computer Centre, University of South Bohemia
Branisovska 31, C. Budejovice, CZ-370 05 Czech Republic


