Kohi Game Engine
kaudio_backend_interface Struct Reference

#include <kaudio_types.h>

Data Fields

struct kaudio_backend_state * internal_state
 
b8(* initialize )(struct kaudio_backend_interface *backend, const kaudio_backend_config *config)
 
void(* shutdown )(struct kaudio_backend_interface *backend)
 
b8(* update )(struct kaudio_backend_interface *backend, struct frame_data *p_frame_data)
 
b8(* listener_position_set )(struct kaudio_backend_interface *backend, vec3 position)
 
b8(* listener_orientation_set )(struct kaudio_backend_interface *backend, vec3 forward, vec3 up)
 
b8(* channel_gain_set )(struct kaudio_backend_interface *backend, u8 channel_id, f32 gain)
 
b8(* channel_pitch_set )(struct kaudio_backend_interface *backend, u8 channel_id, f32 pitch)
 
b8(* channel_position_set )(struct kaudio_backend_interface *backend, u8 channel_id, vec3 position)
 
b8(* channel_looping_set )(struct kaudio_backend_interface *backend, u8 channel_id, b8 looping)
 
b8(* load )(struct kaudio_backend_interface *backend, i32 channels, u32 sample_rate, u32 total_sample_count, u64 pcm_data_size, i16 *pcm_data, b8 is_stream, kaudio audio)
 
void(* unload )(struct kaudio_backend_interface *backend, kaudio audio)
 
b8(* channel_play )(struct kaudio_backend_interface *backend, u8 channel_id)
 
b8(* channel_play_resource )(struct kaudio_backend_interface *backend, kaudio audio, kaudio_space audio_space, u8 channel_id)
 
b8(* channel_stop )(struct kaudio_backend_interface *backend, u8 channel_id)
 
b8(* channel_pause )(struct kaudio_backend_interface *backend, u8 channel_id)
 
b8(* channel_resume )(struct kaudio_backend_interface *backend, u8 channel_id)
 
b8(* channel_is_playing )(struct kaudio_backend_interface *backend, u8 channel_id)
 
b8(* channel_is_paused )(struct kaudio_backend_interface *backend, u8 channel_id)
 
b8(* channel_is_stopped )(struct kaudio_backend_interface *backend, u8 channel_id)
 

Field Documentation

◆ channel_gain_set

b8(* channel_gain_set) (struct kaudio_backend_interface *backend, u8 channel_id, f32 gain)
Parameters
backendA pointer to the backend interface.
channel_idThe identifier of the channel to modify.
gainIndicate the gain (volume amplification) applied. Range: [0.0f - ? ] A value of 1.0 means un-attenuated/unchanged. Each division by 2 equals an attenuation of -6dB. Each multiplicaton with 2 equals an amplification of +6dB. A value of 0.0f is meaningless with respect to a logarithmic scale; it is interpreted as zero volume - the channel is effectively disabled.
Returns
True on success; otherwise false.

◆ channel_is_paused

b8(* channel_is_paused) (struct kaudio_backend_interface *backend, u8 channel_id)

◆ channel_is_playing

b8(* channel_is_playing) (struct kaudio_backend_interface *backend, u8 channel_id)

◆ channel_is_stopped

b8(* channel_is_stopped) (struct kaudio_backend_interface *backend, u8 channel_id)

◆ channel_looping_set

b8(* channel_looping_set) (struct kaudio_backend_interface *backend, u8 channel_id, b8 looping)

◆ channel_pause

b8(* channel_pause) (struct kaudio_backend_interface *backend, u8 channel_id)

◆ channel_pitch_set

b8(* channel_pitch_set) (struct kaudio_backend_interface *backend, u8 channel_id, f32 pitch)
Parameters
backendA pointer to the backend interface.
channel_idThe identifier of the channel to modify.
Specifythe pitch to be applied at source. Range: [0.5f - 2.0f] Default: 1.0f
Returns
True on success; otherwise false.

◆ channel_play

b8(* channel_play) (struct kaudio_backend_interface *backend, u8 channel_id)

◆ channel_play_resource

b8(* channel_play_resource) (struct kaudio_backend_interface *backend, kaudio audio, kaudio_space audio_space, u8 channel_id)

◆ channel_position_set

b8(* channel_position_set) (struct kaudio_backend_interface *backend, u8 channel_id, vec3 position)

◆ channel_resume

b8(* channel_resume) (struct kaudio_backend_interface *backend, u8 channel_id)

◆ channel_stop

b8(* channel_stop) (struct kaudio_backend_interface *backend, u8 channel_id)

◆ initialize

b8(* initialize) (struct kaudio_backend_interface *backend, const kaudio_backend_config *config)

◆ internal_state

struct kaudio_backend_state* internal_state

◆ listener_orientation_set

b8(* listener_orientation_set) (struct kaudio_backend_interface *backend, vec3 forward, vec3 up)

◆ listener_position_set

b8(* listener_position_set) (struct kaudio_backend_interface *backend, vec3 position)

◆ load

b8(* load) (struct kaudio_backend_interface *backend, i32 channels, u32 sample_rate, u32 total_sample_count, u64 pcm_data_size, i16 *pcm_data, b8 is_stream, kaudio audio)

◆ shutdown

void(* shutdown) (struct kaudio_backend_interface *backend)

◆ unload

void(* unload) (struct kaudio_backend_interface *backend, kaudio audio)

◆ update

b8(* update) (struct kaudio_backend_interface *backend, struct frame_data *p_frame_data)

The documentation for this struct was generated from the following file: