From: "Wes Bauske" <wsb@paralleldata.com>
To: axp-list@redhat.com
Subject: Re: Sound installed but now what???
Date: Thu, 12 Nov 1998 20:17:15 +0000 [thread overview]
Message-ID: <364B424B.2B659C4B@paralleldata.com> (raw)
In-Reply-To: 199811120747.XAA02961@ann.qtpi.lakewood.ca.us
Bob Taylor wrote:
>
> In the file au.c:
>
> #define SUN_MAGIC 0x2e736e64 /* Really '.snd' */
> #define SUN_INV_MAGIC 0x646e732e /* '.snd' upside-down */
> .
> .
> #define SUN_HDRSIZE 24 /* Size of minimal header */
> .
> #define SUN_ULAW 1 /* u-law encoding */
>
> If SUN_INV_MAGIC is found then swap is set to 1. The header of a .au file
> is:
>
> .snd^@^@^@(^@^@dT^@^@^@^A
>
> where
>
> .snd = SUN_MAGIC
> ^@^@^@( = SUN_HDRSIZE
> ^@^@dT = data size
> ^@^@^@^A = SUN_ULAW (encoding)
>
> I think I just saw a mistake, the SUN_HDRSIZE and SUN_ULAW should be 24L
> and 1L? Anyway the error is reported on the encoding.
>
> The header seems to be big endian.
>
OK now I see how there might be some confusion.
Whether a particular file format is big endian or
little endian is up to the creator of the format.
This does not mean the machine you use it on is
the same endianess. Given the specification of
the file format, one can easily convert between
endianess and do whatever one likes with the file.
However, no matter what endian system you have, you
must have code in the program to take care of
that problem. I do the same thing in my own code.
In much of the file formats used in the petroleum
industry, big endian wins out because when the
format was created, the creator happened to be on
a big endian system. So, whenever I have to read
those formats on Intel/Alpha, I have to swap bytes
around to make any sense of the data.
So you need to worry about both the endianess of
the machine and the endianess of the file and have
code to make them match up or you get nonsense.
Wes
next prev parent reply other threads:[~1998-11-12 20:42 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-11-11 21:04 Sound installed but now what??? Bob Taylor
1998-11-11 23:06 ` Chris Albertson
1998-11-11 23:10 ` Wes Bauske
1998-11-11 23:14 ` Larry Snyder
1998-11-12 1:59 ` Bob Taylor
1998-11-12 3:08 ` Stephen Williams
1998-11-12 3:59 ` Larry Snyder
1998-11-12 4:31 ` Wes Bauske
1998-11-12 4:57 ` Ronald Bruck
1998-11-12 6:52 ` Wes Bauske
1998-11-12 12:41 ` Paul Tomblin
1998-11-12 16:22 ` paride for alpha?? A. Rodriguez-Gonzalez
[not found] ` <A.Rodriguez-Gonzalez@bristol.ac.uk>
1998-11-12 16:43 ` xeno
1998-11-12 7:47 ` Sound installed but now what??? Bob Taylor
1998-11-12 9:24 ` mgraffam
1998-11-12 10:14 ` Bob Taylor
1998-11-12 20:17 ` Wes Bauske [this message]
1998-11-12 23:50 ` Bob Taylor
1998-11-12 17:48 ` Guenter Geiger
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox