summaryrefslogtreecommitdiff
path: root/docs/audio/Samplebank_XML.md
blob: b9c027bcb7fd161d7a99bfd3a1d3088f9e841f66 (plain)
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
# Samplebank XML Format Specification

Samplebank XMLs describe a samplebank file that contains compressed waveform data. It specifies which sample files to include as well as certain global properties such as the index of this samplebank.

---

```xml
<SampleBank
    Name="<C Indentifier>"
    Index="<uint>"
    Medium="<Medium>"
    CachePolicy="<CachePolicy>"
    BufferBug="[bool]"
>
```
Begins a new samplebank.

**Attributes**

- **Name**: The name of the samplebank.
- **Index**: The index of the samplebank for the samplebank table. Must be a unique index for all samplebanks and pointers.
- **Medium**: The storage medium, from the `SampleMedium` enum.
- **CachePolicy**: The cache policy, from the `AudioCacheLoadType` enum.
- <ins>[Optional]</ins> **BufferBug**: Whether this samplebank suffers from a buffer clearing bug present in the original audio tools. For matching only.

**Tags**

-
    ```xml
    <Pointer
        Index="<uint>"
    />
    ```
    Create an alternate index that refers to this samplebank.

    **Attributes**

    - **Index**: The alternative index, must be unique among all samplebanks and pointers.

    ---

-
    ```xml
    <Sample
        Name="<C Identifier>"
        Path="<Path>"
    />
    ```
    Adds a **compressed** sample file to the samplebank. The sample should be single-channel and big-endian, in a format that is recognizable by the audio driver such as: pcm16, vadpcm, or half-frame vadpcm.

    **Attributes**

    - **Name**: Name of this sample. Must be a valid C language identifier.
    - **Path**: Path to aifc file relative to the project root (typically in `$(BUILD_DIR)/assets/audio/samples/`)

    ---

-
    ```xml
    <Blob
        Name="<C Identifier>"
        Path="<Path>"
    />
    ```
    Adds a binary blob to the samplebank. Intended for matching only when data cannot be identified.

    **Attributes**

    - **Name**: Name of this blob. Must be a valid C language identifier.
    - **Path**: Path to binary file, relative to the project root (typically in `$(BUILD_DIR)/assets/audio/samples/`)

    ---

```xml
</SampleBank>
```
---