35 lines
622 B
C
35 lines
622 B
C
|
#pragma once
|
||
|
|
||
|
typedef struct audio_listener {
|
||
|
vec3 position;
|
||
|
vec3 front;
|
||
|
vec3 up;
|
||
|
} audio_listener_t;
|
||
|
|
||
|
typedef struct audio_mgr {
|
||
|
int sound_count;
|
||
|
audio_listener_t listener;
|
||
|
audio_source_t sources[MAX_AUDIO_SOURCE_COUNT];
|
||
|
handle_t index_to_handle_map[MAX_AUDIO_SOURCE_COUNT];
|
||
|
handle_t handle_to_index_map[MAX_AUDIO_SOURCE_COUNT];
|
||
|
} audio_mgr_t;
|
||
|
|
||
|
void
|
||
|
audio_mgr_startup(void);
|
||
|
|
||
|
void
|
||
|
set_listener(vec3 position, vec3 front, vec3 up);
|
||
|
|
||
|
handle_t
|
||
|
play_sound(audio_source_t sound);
|
||
|
|
||
|
void
|
||
|
stop_sound(int handle);
|
||
|
|
||
|
void
|
||
|
update_sound_position(int handle, vec3 position);
|
||
|
|
||
|
void
|
||
|
fill_audio_buffer(uint8_t* buffer, int len);
|
||
|
|