[comp.sys.amiga.audio] ULAW audio encoding

dave@csis.dit.csiro.au (David Campbell) (03/27/91)

Can somebody please explain the difference between an Amiga samples and
ULAW samples.  I have access to some 8-bit ISDN ulaw samples which I want to
convert to run on my Amiga.
All I want to do is convert raw 8-bit ulaw data to raw 8-bit data suitable
for the Amiga.  Forget the IFF sound-file business.

Regards,

-- Dave Campbell
-- dave@csis.dit.csiro.au
-- 
dave campbell

cwpjr@cbnewse.att.com (clyde.w.jr.phillips) (03/29/91)

In article <1991Mar27.111945.15160@csis.dit.csiro.au>, dave@csis.dit.csiro.au (David Campbell) writes:
> Can somebody please explain the difference between an Amiga samples and
> ULAW samples.  I have access to some 8-bit ISDN ulaw samples which I want to
> convert to run on my Amiga.
> All I want to do is convert raw 8-bit ulaw data to raw 8-bit data suitable
> for the Amiga.  Forget the IFF sound-file business.
> 
> Regards,
> 
> -- Dave Campbell
> -- dave@csis.dit.csiro.au
> -- 
> dave campbell

is this what they call an oxymoron? 8bit data suitable for Amiga is IFF.

ISDN doesn't need to use ulaw encoding for 8bit sampling
(ie AMI & ISDN have the same standard capabilities... )
so what's this data from?

gerry@dialogic.com (Gerry Lachac) (03/31/91)

In article <1991Mar28.161224.8705@cbnewse.att.com> cwpjr@cbnewse.att.com (clyde.w.jr.phillips) writes:
>In article <1991Mar27.111945.15160@csis.dit.csiro.au>, dave@csis.dit.csiro.au (David Campbell) writes:

>> All I want to do is convert raw 8-bit ulaw data to raw 8-bit data suitable
>> for the Amiga.  Forget the IFF sound-file business.

Get iff2ulaw.  It should be avalable for ftp from
abcfd20.larc.nasa.gov, I think.  It is a public domain program that
converts uLAW SparcStation sound (raw uLAW) to Amiga IFF, and raw
Amiga sound.  And vice-versa.  It was written for the Sun, but I
converted it to compile under Manx in about 10 minutes.  Depending on
the sampling rate of your sounds, you'll have to change a define in
one of the C files.

>is this what they call an oxymoron? 8bit data suitable for Amiga is IFF.

Not really.  Sound data doesn't *have* to be in IFF format.  That's
just header information fluff with an optional compression algoritm.
All you really need is the raw sound data.

>ISDN doesn't need to use ulaw encoding for 8bit sampling
>(ie AMI & ISDN have the same standard capabilities... )
>so what's this data from?

I don't think you're 100% correct here.  Voice data over a T-1 span
(or ISDN for that matter) comes encoded as uLAW.  This is to cut back
on the amount of voice data transferred.
-- 
uunet!dialogic!gerry   | "Even a dead plant turns  |	Dialogic Corporation
	OR	       |  over a new leaf 	   |	300 Littleton Rd
gerry@dialogic.UUCP    |  when the wind blows."	   |	Parsippany, NJ 07054 
		       |  			   |	(201)334-8450

mykes@amiga0.SF-Bay.ORG (Mike Schwartz) (03/31/91)

In article <1991Mar30.172254.26452@dialogic.com> gerry@dialogic.com (Gerry Lachac) writes:
>In article <1991Mar28.161224.8705@cbnewse.att.com> cwpjr@cbnewse.att.com (clyde.w.jr.phillips) writes:
>>In article <1991Mar27.111945.15160@csis.dit.csiro.au>, dave@csis.dit.csiro.au (David Campbell) writes:
>
>>> All I want to do is convert raw 8-bit ulaw data to raw 8-bit data suitable
>>> for the Amiga.  Forget the IFF sound-file business.
>
>Get iff2ulaw.  It should be avalable for ftp from
>abcfd20.larc.nasa.gov, I think.  It is a public domain program that
>converts uLAW SparcStation sound (raw uLAW) to Amiga IFF, and raw
>Amiga sound.  And vice-versa.  It was written for the Sun, but I
>converted it to compile under Manx in about 10 minutes.  Depending on
>the sampling rate of your sounds, you'll have to change a define in
>one of the C files.
>
>>is this what they call an oxymoron? 8bit data suitable for Amiga is IFF.
>
>Not really.  Sound data doesn't *have* to be in IFF format.  That's
>just header information fluff with an optional compression algoritm.
>All you really need is the raw sound data.
>

True, if you load an IFF file and play it out the DAC, all you get is
a little pop sound at the beginning where the IFF header data is.

>>ISDN doesn't need to use ulaw encoding for 8bit sampling
>>(ie AMI & ISDN have the same standard capabilities... )
>>so what's this data from?
>
>I don't think you're 100% correct here.  Voice data over a T-1 span
>(or ISDN for that matter) comes encoded as uLAW.  This is to cut back
>on the amount of voice data transferred.

Where can I get specs on uLAW?

>-- 
>uunet!dialogic!gerry   | "Even a dead plant turns  |	Dialogic Corporation
>	OR	       |  over a new leaf 	   |	300 Littleton Rd
>gerry@dialogic.UUCP    |  when the wind blows."	   |	Parsippany, NJ 07054 
>		       |  			   |	(201)334-8450

--
********************************************************
* Appendix A of the Amiga Hardware Manual tells you    *
* everything you need to know to take full advantage   *
* of the power of the Amiga.  And it is only 10 pages! *
********************************************************

gerry@dialogic.com (Gerry Lachac) (04/02/91)

In article <mykes.0904@amiga0.SF-Bay.ORG> mykes@amiga0.SF-Bay.ORG (Mike Schwartz) writes:
>
>Where can I get specs on uLAW?


A good book on T-1 or on telephony will explain uLAW.  Briefly
explained uLAW is a way of encoding PCM (pulse code modulation) into 8
bits.

On a T-1, voice is transmitted at 8000 samples per second, with 8 bits
per sample. PCM is a complete description of every sample (ie it is
NOT a delta, that is ADPCM).  If you were to chart uLAW, it would look
like this:

	MU-LAW bits		Value (on a scale of +127 to -127)
	10000000		+127  	(peak positive level)
	10101111		+80
	11111111		0
	01111111		-1 
	00000010		-126
	00000010		-127


Note that the first bit is a sign bit. (0 negative, 1 positive) For
positive numbers, flip the remaining 7 bits, and the value is the
distance about 0.  For negative numbers, flip the 7 bits add 1 and
that's the distance below zero.  Remember that you can't have all
zeros because that would be 8 zeroes in a row, which would break a T-1
timing rule.

This is basic uLAW (from memory and glancing at a book real quick, so
don't exactly quote me on all this.  verify with a good book).

Good luck.
	


-- 
uunet!dialogic!gerry   | "Even a dead plant turns  |	Dialogic Corporation
	OR	       |  over a new leaf 	   |	300 Littleton Rd
gerry@dialogic.UUCP    |  when the wind blows."	   |	Parsippany, NJ 07054 
		       |  			   |	(201)334-8450