diff --git a/include/audio/config.h b/include/audio/config.h new file mode 100644 index 0000000..c491826 --- /dev/null +++ b/include/audio/config.h @@ -0,0 +1,8 @@ +#ifndef VBX_AUDIO_CONFIG_H +#define VBX_AUDIO_CONFIG_H + +#include "audio/types.h" + +int load_sound_config(const char *config_path, SoundPack *pack); + +#endif // VBX_AUDIO_CONFIG_H diff --git a/include/audio/types.h b/include/audio/types.h index 743a725..ad3c0bb 100644 --- a/include/audio/types.h +++ b/include/audio/types.h @@ -8,23 +8,43 @@ typedef struct { int start_ms; int duration_ms; + short *pcm_data; + uint32_t num_samples; } SoundMapping; typedef struct { char press_file[256]; char release_file[256]; char generic_press_files[5][256]; + short *generic_press_data[5]; + uint32_t generic_press_samples[5]; int num_generic_press_files; char sound_file[256]; + short *release_data; + uint32_t release_samples; SoundMapping key_mappings[512]; struct { char *press; char *release; + short *press_data; + uint32_t press_samples; + short *release_data; + uint32_t release_samples; } multi_key_mappings[512]; int is_multi; SF_INFO sf_info; } SoundPack; +typedef struct { + short *data; + uint32_t total_samples; + uint32_t current_pos; + float volume; + int active; +} AudioVoice; + +#define MAX_MIXER_VOICES 32 + typedef struct { int key_code; int thread_id;