-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathfile_format.txt
116 lines (97 loc) · 6.32 KB
/
file_format.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
IRS File Format Version 1
IRS = Impulse Response Simulation
This file format specifies impulse responses as a function of source and listener positions.
Little-endian should be used. The header contains the text "iSim", which will
read as "miSi" on a big-endian system.
--------------------------------------------------------------------------------
File Format
--------------------------------------------------------------------------------
Field Size (bytes) Type Description
--------------------------------------------------------------------------------
<Header> 44 (version 1) header The file header.
<Source Table> - sTable A table containing file offsets for
every source that was simulated.
<Listener Table> - lTable A table containing information about
all the listeners in the scene.
<Data> - data Data containing all impulse responses.
For each source, then for each listener
corresponding to that source, the data
is dumped. This should be a strict
ordering, however each chunk contains
enough metadata in case the ordering is
wrong.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Header
--------------------------------------------------------------------------------
Field Size (bytes) Type Description
--------------------------------------------------------------------------------
format 4 str Should always contain the text "iSim".
version 4 int File format version (1).
hdrSize 4 int Total size of the header (44 bytes).
sizeX 4 int The length of the scene in voxels.
sizeY 4 int The height of the scene in voxels.
sizeZ 4 int The depth of the scene in voxels.
samplingRate 4 int Number of samples per second.
c 4 float Speed of sound (voxels/sample).
scale 4 float Voxels per metre.
nSources 4 int The number of source simulations
contained in this file.
nListeners 4 int The number of listeners per source
with simulation data.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Source Table Chunk (sTable)
--------------------------------------------------------------------------------
Field Size (bytes) Type Description
--------------------------------------------------------------------------------
size 4 int Total size of this chunk in bytes.
nEntries 4 int The number of entries in the table.
<Entries> - <sEntry> An array of table entries.
--------------------------------------------------------------------------------
---------------------------------------------------------------------------------
Source Table Entry (sEntry)
size = 24 bytes
---------------------------------------------------------------------------------
Field Size (bytes) Type Description
---------------------------------------------------------------------------------
id 4 int ID of the sound source.
xPos 4 int The x coordinate of the sound source.
yPos 4 int The y coordinate of the sound source.
zPos 4 int The z coordinate of the sound source.
sType 4 int 0: Gaussian
nSamples 4 int The number of samples the simulation ran
for this source.
---------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Listener Table Chunk (lTable)
size = 4 + nListeners*16 bytes
--------------------------------------------------------------------------------
Field Size (bytes) Type Description
--------------------------------------------------------------------------------
size 4 int Total size of this chunk in bytes.
nEntries 4 int The number of entries in the table.
<Entries> nEntries*16 <lEntry> An array of table entries.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Listener Table Entry (lEntry)
size = 16 bytes
--------------------------------------------------------------------------------
Field Size (bytes) Type Description
--------------------------------------------------------------------------------
id 4 int ID of the listener.
xPos 4 int The x coordinate of the listener.
yPos 4 int The y coordinate of the listener.
zPos 4 int The z coordinate of the listener.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Data Chunk
--------------------------------------------------------------------------------
Field Size (bytes) Type Description
--------------------------------------------------------------------------------
size 4 int Size of this data chunk.
sourceID 4 int Source ID this chunk corresponds to.
listenerID 4 int Listener ID this chunk corresponds to.
<Raw data> size*4 floats The impulse response as an array of
samples.
--------------------------------------------------------------------------------