[comp.sys.atari.st] Converting Sparcstation .au files to Mac/Atari format

dmb@wam.umd.edu (David M. Baggett) (05/09/91)

In article <1991May8.055008.2758@isc.rit.edu> drp9500@isc.rit.edu (D.R. Paradis ) writes:
>sound files with the .au extender are Sun Audio files.
>
>As of now I cannot figure how to convert them into ANY format that the
>ST can handle.  :-(

The Atari uses the same sample data format as the Mac, so if there's
a way to convert Sparcstation samples to Mac format, you can use
them (the data forks) on the Atari as well.

Could some kind Mac wizard point me to a Sparc->Mac sample converter?
Given source for such a utility I could write an ST version and make
many Atari owners happy.  (Or at least happier.)

Thanks,

Dave Baggett
dmb%wam.umd.edu@uunet.uu.net

dave@msb.com (Dave Lockwood) (05/13/91)

Converting the .au samples is a snap.  According to the audio man page on my
system, the Sun audio data is 8 bit signed volume values.  The high order bit
is a sign bit.  If set, the volume is positive (1's compliment), and if the
sign bit is 0, the value is a negative volume (also 1's compliment).

In a C program reading the Sun audio data, stick this code in the middle of
the conversion loop:

if(value & 128)
  value = 128 + (127 - (value & 127));

See...baby food.  If the sign bit isn't set, no conversion need be done.  The
resulting output is a volume level from 0 to 255 with 128 being the zero
crossing.  Multiply the result by a fraction if you want to change the volume
before output.

I'll leave the headers up to you.  I never monkeyed with that (the man page is
rather cryptic about this), and besides, you wouldn't want me to take ALL the
fun out of it, would you? ;-)
-- 
A tool that isn't sharp enough to cut    | dave@msb.com (Dave Lockwood)
you badly isn't sharp enough to use.     | UUCP: ...!uupsi!mpoint!dave
However, the sharp edges should *NOT* be | Sysop of Meetpoint Station BBS
on the handle.                           | cat flames | mail santa@north.pole