Click to See Complete Forum and Search --> : Knowing the endianess of a system


asarch
10-23-2004, 01:42 PM
Reading the man page of cdparanoia I learn that you can select the endianess of a wave file, the question is how can I know the endianess of my system? and is there any command to know it?

Hayl
10-23-2004, 02:50 PM
x86 (amd/intel) is little-endian.

if you google or google for linux on it, there are many hits on the subject.

bwkaz
10-23-2004, 04:54 PM
$ cat /usr/include/bits/endian.h
/* i386 is little-endian. */

#ifndef _ENDIAN_H
# error "Never use <bits/endian.h> directly; include <endian.h> instead."
#endif

#define __BYTE_ORDER __LITTLE_ENDIAN
$ The important parts are the comment at the beginning of the file, and the #define at the end.

However, the endianness that the cdparanoia manpages are referring to does NOT necessarily need to be the same endianness of your system. Audio CDs are burned (or stamped) in big-endian format, always. Therefore, the audio that you rip from a CD using cdparanoia is also, by default, in big-endian order. So if you want to burn a second audio CD, you have to make sure you invert the endianness an even number of times (or, preferably, zero).

asarch
10-23-2004, 05:59 PM
What do you mean with you have to make sure you invert the endianness an even number of times?

Because as I understand, the audio that you rip from a CD using cdparanoia is also, by default, in big-endian order, the blue color means big endian and the red color means little endianess:

cdda track -> ripper -> wave file

Now, if I want to burn this wave file:

wave file -> sox -> cdr file -> cdrecord -> cdda track

unless this happends:

cdda track -> ripper -> wave file

bwkaz
10-24-2004, 01:53 PM
Zero is even. ;) Unless I misunderstand what you're asking?

leonpmu
10-27-2004, 07:39 AM
I am thick as a brick......

what is endian?

Hayl
10-27-2004, 07:45 AM
Originally posted by leonpmu
I am thick as a brick......

what is endian?

as was already stated earlier, if you enter endian into google or google for linux - ther are a ton of hits that explain exactly what it is.

asarch
10-27-2004, 10:35 AM
Check this out (http://en.wikipedia.org/wiki/Endianess) :D