Sound Bakery  v0.1.0
Open-source audio middleware for games
Loading...
Searching...
No Matches
sound_chef_bank.h
Go to the documentation of this file.
1#ifndef SOUND_CHEF_BANK
2#define SOUND_CHEF_BANK
3
11#include "sound_chef/sound_chef_common.h"
12
13#define SC_BANK_VERSION 1u
14
15#define FOURCC(a, b, c, d) ((ma_uint32)(((d) << 24) | ((c) << 16) | ((b) << 8) | (a)))
16
17#define SC_BANK_ID (FOURCC('S', 'C', 'B', 'K'))
18#define SC_BANK_AUDIO_CHUNK_ID (FOURCC('S', 'C', 'A', 'C'))
19#define SC_BANK_SUB_ID (FOURCC('S', 'C', 'F', 'E'))
20
21#ifdef __cplusplus
22extern "C"
23{
24#endif
25
26 typedef struct sc_bank sc_bank;
27
28 typedef struct sc_subChunk sc_subChunk;
29 typedef struct sc_riffChunk sc_riffChunk;
30 typedef struct sc_audioChunk sc_audioChunk;
31
32 enum
33 {
34 SC_BANK_FILE_NAME_BUFFER_SIZE = 64
35 };
36
38 {
39 ma_uint32 id;
40 ma_uint32 size;
41 char name[SC_BANK_FILE_NAME_BUFFER_SIZE];
42 void* data;
43 };
44
46 {
47 ma_uint32 id;
48 ma_uint32 size;
49 ma_uint32 version;
50 ma_uint32 numOfSubchunks;
51 sc_audioChunk** subChunks;
52 };
53
54 struct sc_bank
55 {
56 sc_riffChunk* riff; //< bank data. Filled upon reading
57 ma_vfs_file outputFile; //< bank file used during read and write
58 };
59
60 sc_result SC_API sc_bank_init(sc_bank* bank, const char* outputFile, ma_open_mode_flags openFlags);
61 sc_result SC_API sc_bank_uninit(sc_bank* bank);
62
63 sc_result SC_API sc_bank_build(sc_bank* bank,
64 const char** inputFiles,
65 sc_encoding_format* inputFileFormats,
66 ma_uint32 inputFilesSize);
67 sc_result SC_API sc_bank_read(sc_bank* bank);
68
69#ifdef __cplusplus
70}
71#endif
72
73#endif
Definition sound_chef_bank.h:38
Definition sound_chef_bank.h:55
Definition sound_chef_bank.h:46