#pragma once #include #include #include /*! \file sound.h \brief Sounds are pre-decoded on load and therefore primarily useful for playing sound-effects. */ #ifdef __cplusplus extern "C" { #endif typedef struct kinc_a1_sound { uint8_t channel_count; uint8_t bits_per_sample; uint32_t samples_per_second; int16_t *left; int16_t *right; int size; float sample_rate_pos; float volume; bool in_use; } kinc_a1_sound_t; /// /// Create a sound from a wav file. /// /// Path to a wav file /// The newly created sound KINC_FUNC kinc_a1_sound_t *kinc_a1_sound_create(const char *filename); /// /// Destroy a sound. /// /// The sound to destroy. KINC_FUNC void kinc_a1_sound_destroy(kinc_a1_sound_t *sound); /// /// Gets the current volume-multiplicator that's used when playing the sound. /// /// The sound to query /// The volume-multiplicator KINC_FUNC float kinc_a1_sound_volume(kinc_a1_sound_t *sound); /// /// Sets the volume-multiplicator that's used when playing the sound. /// /// The sound to modify /// The volume-multiplicator to set KINC_FUNC void kinc_a1_sound_set_volume(kinc_a1_sound_t *sound, float value); #ifdef __cplusplus } #endif