Sound Bakery  v0.1.0
Open-source audio middleware for games
Loading...
Searching...
No Matches
sound_chef_encoder.h
Go to the documentation of this file.
1#ifndef SOUND_CHEF_ENCODER
2#define SOUND_CHEF_ENCODER
3
11#include "sound_chef/sound_chef_common.h"
12
13#ifdef __cplusplus
14extern "C"
15{
16#endif
17
19 typedef struct sc_encoder sc_encoder;
20
22 {
23 ma_encoder_config baseConfig;
24 ma_uint8 quality; //< quality setting for formats that allow it
25 sc_encoding_format encodingFormat;
26 };
27
29 {
30 ma_encoder baseEncoder;
31 sc_encoder_config config;
32 };
33
34 sc_encoder_config SC_API sc_encoder_config_init(sc_encoding_format encodingFormat,
35 ma_format format,
36 ma_uint32 channels,
37 ma_uint32 sampleRate,
38 ma_uint8 quality);
39
40 sc_result SC_API sc_encoder_init(ma_encoder_write_proc onWrite,
41 ma_encoder_seek_proc onSeek,
42 void* userData,
43 const sc_encoder_config* config,
44 sc_encoder* encoder);
45
46 sc_result SC_API sc_encoder_init_file(const char* filePath, const sc_encoder_config* config, sc_encoder* encoder);
47
48 sc_result SC_API sc_encoder_write_pcm_frames(sc_encoder* encoder,
49 const void* framesIn,
50 ma_uint64 frameCount,
51 ma_uint64* framesWritten);
52
53 sc_result SC_API sc_encoder_uninit(sc_encoder* encoder);
54
55 //
56
57 sc_result SC_API sc_encoder_write_from_file(const char* decodeFilePath,
58 const char* encodeFilePath,
59 const sc_encoder_config* config);
60
61#ifdef __cplusplus
62}
63#endif
64
65#endif
Definition sound_chef_encoder.h:22
Definition sound_chef_encoder.h:29