The .EAR file format

The .EAR file defines the configuration of sound sources, listeners, surfaces and settings as it is defined in the modelling application. It is a little-endian binary file, designed to eventually make embedding binary data easy, for example audio streams. The lay-out of the file is based on a sequence of blocks with a 4 byte header and block length that contain a number of positional arguments. The arguments that are defined depend on the type of block. Each argument is again prefixed with a 4 byte type identifier. Strings are null-terminated and padded to fall between 4 byte alignment boundaries. All other types are a multitude of 4 bytes by nature.

Header

.
0x2e
E
0x45
A
0x41
R
0x52

  V
0x56
R
0x52
S
0x53
N
0x4e
i
0x69
n
0x6e
t
0x74
4
0x34
 
0x00
 
0x00
 
0x00
 
0x00

The file starts with a header and a version to identify the file. As of writing the version is always 0 (0x00 0x00 0x00 0x00).

Settings block

S
0x53
E
0x45
T
0x54

0x20
length (UINT)0xXX 0xXX 0xXX 0xXX
Several settings can be listed in the file that define the behaviour of the rendering application.

• Debug

s
0x73
t
0x74
r
0x72

0x20
d
0x64
e
0x65
b
0x62
u
0x75
g
0x67
 
0x00
 
0x00
 
0x00
i
0x69
n
0x6e
t
0x74
4
0x34
debug (UINT)0xXX 0xXX 0xXX 0xXX
Whether to print debugging output to stdout. 0 to disable, 1 to enable.

• Air absorption

s
0x73
t
0x74
r
0x72

0x20
a
0x61
b
0x62
s
0x73
o
0x6f
r
0x72
p
0x70
t
0x74
i
0x69
o
0x6f
n
0x6e
 
0x00
 
0x00
v
0x76
e
0x65
c
0x63
3
0x33
f
0x66
l
0x6c
t
0x74
4
0x34

alow (FLOAT)0xXX 0xXX 0xXX 0xXXf
0x66
l
0x6c
t
0x74
4
0x34
amid (FLOAT)0xXX 0xXX 0xXX 0xXXf
0x66
l
0x6c
t
0x74
4
0x34
ahigh (FLOAT)0xXX 0xXX 0xXX 0xXX
The air absorption for the external medium of the scene specified as three floating point numbers for the three frequency ranges

• Dry sound level

s
0x73
t
0x74
r
0x72

0x20
d
0x64
r
0x72
y
0x79
l
0x6c
e
0x65
v
0x76
e
0x65
l
0x6c
 
0x00
 
0x00
 
0x00
 
0x00
f
0x66
l
0x6c
t
0x74
4
0x34
drylevel (FLOAT)0xXX 0xXX 0xXX 0xXX
A debugging parameter to define to what extent direct sound is mixed in the final result

• Number of samples

s
0x73
t
0x74
r
0x72

0x20
s
0x73
a
0x61
m
0x6d
p
0x70
l
0x6c
e
0x65
s
0x73
 
0x00
i
0x69
n
0x6e
t
0x74
4
0x34
samples (INT)0xXX 0xXX 0xXX 0xXX
The amount of rays to trace

• Threads

s
0x73
t
0x74
r
0x72

0x20
m
0x6d
a
0x61
x
0x78
t
0x74
h
0x68
r
0x72
e
0x65
a
0x61
d
0x64
s
0x73
 
0x00
 
0x00
i
0x69
n
0x6e
t
0x74
4
0x34
threads (INT)0xXX 0xXX 0xXX 0xXX
The maximum amount of threads the application may use

• Debug directory

s
0x73
t
0x74
r
0x72

0x20
d
0x64
e
0x65
b
0x62
u
0x75
g
0x67
d
0x64
i
0x69
r
0x72
 
0x00
 
0x00
 
0x00
 
0x00
s
0x73
t
0x74
r
0x72

0x20
path (STR)0xXX 0xXX 0xXX 0xXX
... (STR)0xXX 0xXX 0xXX 0xXX
The directory to store debugging output in

• Center frequencies

s
0x73
t
0x74
r
0x72

0x20
f
0x66
r
0x72
e
0x65
q
0x71
 
0x00
 
0x00
 
0x00
 
0x00
v
0x76
e
0x65
c
0x63
3
0x33
f
0x66
l
0x6c
t
0x74
4
0x34
low (FLOAT)0xXX 0xXX 0xXX 0xXX
f
0x66
l
0x6c
t
0x74
4
0x34
mid (FLOAT)0xXX 0xXX 0xXX 0xXXf
0x66
l
0x6c
t
0x74
4
0x34
high (FLOAT)0xXX 0xXX 0xXX 0xXX
The center frequencies of the three frequency ranges. This parameter is used by the equalizer algorithm to split audio files into three frequency ranges.

Animation key-frames block

K
0x4b
E
0x45
Y
0x59
S
0x53
length (UINT)0xXX 0xXX 0xXX 0xXXf
0x66
l
0x6c
t
0x74
4
0x34
time1 (FLOAT)0xXX 0xXX 0xXX 0xXXf
0x66
l
0x6c
t
0x74
4
0x34
... (FLOAT)0xXX 0xXX 0xXX 0xXX
f
0x66
l
0x6c
t
0x74
4
0x34
timen (FLOAT)0xXX 0xXX 0xXX 0xXX
This block defines the global key-frame time offsets for animated listeners and sound sources.

Listener block

As of writing there are two kinds of listeners:

• An omni-directional mono listener that captures sounds equally from every direction

O
0x4f
U
0x55
T
0x54
1
0x31
length (UINT)0xXX 0xXX 0xXX 0xXXs
0x73
t
0x74
r
0x72

0x20
path (STR)0xXX 0xXX 0xXX 0xXX... (STR)0xXX 0xXX 0xXX 0xXX
What follows is the positioning of the listener, which can either be static or animated.

• Static

v
0x76
e
0x65
c
0x63
3
0x33
f
0x66
l
0x6c
t
0x74
4
0x34
x (FLOAT)0xXX 0xXX 0xXX 0xXXf
0x66
l
0x6c
t
0x74
4
0x34
y (FLOAT)0xXX 0xXX 0xXX 0xXXf
0x66
l
0x6c
t
0x74
4
0x34

z (FLOAT)0xXX 0xXX 0xXX 0xXX

• Animated

a
0x61
n
0x6e
i
0x69
m
0x6d
length (UINT)0xXX 0xXX 0xXX 0xXXv
0x76
e
0x65
c
0x63
3
0x33
f
0x66
l
0x6c
t
0x74
4
0x34
x1 (FLOAT)0xXX 0xXX 0xXX 0xXXf
0x66
l
0x6c
t
0x74
4
0x34

y1 (FLOAT)0xXX 0xXX 0xXX 0xXXf
0x66
l
0x6c
t
0x74
4
0x34
z1 (FLOAT)0xXX 0xXX 0xXX 0xXXv
0x76
e
0x65
c
0x63
3
0x33
f
0x66
l
0x6c
t
0x74
4
0x34
... (FLOAT)0xXX 0xXX 0xXX 0xXX
f
0x66
l
0x6c
t
0x74
4
0x34
... (FLOAT)0xXX 0xXX 0xXX 0xXXf
0x66
l
0x6c
t
0x74
4
0x34
... (FLOAT)0xXX 0xXX 0xXX 0xXXv
0x76
e
0x65
c
0x63
3
0x33
f
0x66
l
0x6c
t
0x74
4
0x34

xn (FLOAT)0xXX 0xXX 0xXX 0xXXf
0x66
l
0x6c
t
0x74
4
0x34
yn (FLOAT)0xXX 0xXX 0xXX 0xXXf
0x66
l
0x6c
t
0x74
4
0x34
zn (FLOAT)0xXX 0xXX 0xXX 0xXX
The number of animation frames in this block needs to be equal to the amount of key-frame time offsets that is defined by the Animation key-frames block.

• A stereo listener that also has an orientation apart from a location

O
0x4f
U
0x55
T
0x54
2
0x32
length (UINT)0xXX 0xXX 0xXX 0xXXs
0x73
t
0x74
r
0x72

0x20
path (STR)0xXX 0xXX 0xXX 0xXX... (STR)0xXX 0xXX 0xXX 0xXX
What follows is two times either an anim block or a vec3 block. The first block determines the positioning of the listener in a similar fashion as with the mono listener. The second block defines a vector that defines the orientation of the right ear of the listener. The definition the right ear is the same as that of the positioning, but the right ear is defined using (a sequence of) normalized directional vectors rather than Cartesian coordinates.

Sound source block

As of writing there are two kinds of listeners:

• A single sound file source

S
0x53
S
0x53
R
0x52
C
0x43
length (UINT)0xXX 0xXX 0xXX 0xXXf
0x66
l
0x6c
t
0x74
4
0x34
gain (FLOAT)0xXX 0xXX 0xXX 0xXXs
0x73
t
0x74
r
0x72

0x20
path (STR)0xXX 0xXX 0xXX 0xXX
... (STR)0xXX 0xXX 0xXX 0xXX
An equalizer algorithm will be used to separate the sound file into the three frequency ranges, using the center frequencies as defined in the Settings block.

• A triple sound file source

S
0x53
R
0x52
C
0x43
3
0x33
length (UINT)0xXX 0xXX 0xXX 0xXXf
0x66
l
0x6c
t
0x74
4
0x34
gain (FLOAT)0xXX 0xXX 0xXX 0xXXs
0x73
t
0x74
r
0x72

0x20
pathlow (STR)0xXX 0xXX 0xXX 0xXX
... (STR)0xXX 0xXX 0xXX 0xXXs
0x73
t
0x74
r
0x72

0x20
pathmid (STR)0xXX 0xXX 0xXX 0xXX... (STR)0xXX 0xXX 0xXX 0xXXs
0x73
t
0x74
r
0x72

0x20
pathhigh (STR)0xXX 0xXX 0xXX 0xXX
... (STR)0xXX 0xXX 0xXX 0xXX
A sound file the explicitly defines input for the three different frequency bands.

Material block

M
0x4d
A
0x41
T
0x54

0x20
length (UINT)0xXX 0xXX 0xXX 0xXXs
0x73
t
0x74
r
0x72

0x20
name (STR)0xXX 0xXX 0xXX 0xXX... (STR)0xXX 0xXX 0xXX 0xXXv
0x76
e
0x65
c
0x63
3
0x33

f
0x66
l
0x6c
t
0x74
4
0x34
refllow (FLOAT)0xXX 0xXX 0xXX 0xXXf
0x66
l
0x6c
t
0x74
4
0x34
reflmid (FLOAT)0xXX 0xXX 0xXX 0xXXf
0x66
l
0x6c
t
0x74
4
0x34
reflhigh (FLOAT)0xXX 0xXX 0xXX 0xXX
v
0x76
e
0x65
c
0x63
3
0x33
f
0x66
l
0x6c
t
0x74
4
0x34
refrlow (FLOAT)0xXX 0xXX 0xXX 0xXXf
0x66
l
0x6c
t
0x74
4
0x34
refrmid (FLOAT)0xXX 0xXX 0xXX 0xXXf
0x66
l
0x6c
t
0x74
4
0x34

refrhigh (FLOAT)0xXX 0xXX 0xXX 0xXXv
0x76
e
0x65
c
0x63
3
0x33
f
0x66
l
0x6c
t
0x74
4
0x34
explow (FLOAT)0xXX 0xXX 0xXX 0xXXf
0x66
l
0x6c
t
0x74
4
0x34
expmid (FLOAT)0xXX 0xXX 0xXX 0xXX
f
0x66
l
0x6c
t
0x74
4
0x34
exphigh (FLOAT)0xXX 0xXX 0xXX 0xXX
A material defines the percentages of energy being reflected, refracted and absorbed when a sound ray hits a mesh triangle. The exponent defines to what extent rays are diffusely scattered or reflected mirror-like. The absorption of the material is calculated as a = 1 - (relf+refr).

Mesh block

M
0x4d
E
0x45
S
0x53
H
0x48
length (UINT)0xXX 0xXX 0xXX 0xXXs
0x73
t
0x74
r
0x72

0x20
material (STR)0xXX 0xXX 0xXX 0xXX... (STR)0xXX 0xXX 0xXX 0xXXt
0x74
r
0x72
i
0x69

0x20

v
0x76
e
0x65
c
0x63
3
0x33
f
0x66
l
0x6c
t
0x74
4
0x34
x1,1 (FLOAT)0xXX 0xXX 0xXX 0xXXf
0x66
l
0x6c
t
0x74
4
0x34
y1,1 (FLOAT)0xXX 0xXX 0xXX 0xXXf
0x66
l
0x6c
t
0x74
4
0x34

z1,1 (FLOAT)0xXX 0xXX 0xXX 0xXXv
0x76
e
0x65
c
0x63
3
0x33
f
0x66
l
0x6c
t
0x74
4
0x34
x1,2 (FLOAT)0xXX 0xXX 0xXX 0xXXf
0x66
l
0x6c
t
0x74
4
0x34
y1,2 (FLOAT)0xXX 0xXX 0xXX 0xXX
f
0x66
l
0x6c
t
0x74
4
0x34
z1,2 (FLOAT)0xXX 0xXX 0xXX 0xXXv
0x76
e
0x65
c
0x63
3
0x33
f
0x66
l
0x6c
t
0x74
4
0x34
x1,3 (FLOAT)0xXX 0xXX 0xXX 0xXXf
0x66
l
0x6c
t
0x74
4
0x34

y1,3 (FLOAT)0xXX 0xXX 0xXX 0xXXf
0x66
l
0x6c
t
0x74
4
0x34
z1,3 (FLOAT)0xXX 0xXX 0xXX 0xXX
Followed by an optional amount of additional triangles. This block defines the Cartesian coordinates of the triangles of a sound reflecting surface. The material string references a Material block by name.