Sounds are pre-decoded on load and therefore primarily useful for playing sound-effects.
More...
#include <kinc/global.h>
#include <kinc/audio2/audio.h>
#include <stdint.h>
Go to the source code of this file.
|
| enum | kinc_a1_audioformat_t { KINC_A1_AUDIOFORMAT_WAV
, KINC_A1_AUDIOFORMAT_OGG
} |
|
| KINC_FUNC kinc_a1_sound_t * | kinc_a1_sound_create (const char *filename) |
| | Create a sound from a wav or ogg file.
|
| KINC_FUNC kinc_a1_sound_t * | kinc_a1_sound_create_from_buffer (uint8_t *audio_data, const uint32_t size, kinc_a1_audioformat_t format) |
| | Create a sound from a buffer.
|
| KINC_FUNC void | kinc_a1_sound_destroy (kinc_a1_sound_t *sound) |
| | Destroy a sound.
|
| KINC_FUNC float | kinc_a1_sound_volume (kinc_a1_sound_t *sound) |
| | Gets the current volume-multiplicator that's used when playing the sound.
|
| KINC_FUNC void | kinc_a1_sound_set_volume (kinc_a1_sound_t *sound, float value) |
| | Sets the volume-multiplicator that's used when playing the sound.
|
Sounds are pre-decoded on load and therefore primarily useful for playing sound-effects.
◆ kinc_a1_sound_create()
| KINC_FUNC kinc_a1_sound_t * kinc_a1_sound_create |
( |
const char * | filename | ) |
|
Create a sound from a wav or ogg file.
- Parameters
-
| filename | Path to a wav or ogg file |
- Returns
- The newly created sound
◆ kinc_a1_sound_create_from_buffer()
| KINC_FUNC kinc_a1_sound_t * kinc_a1_sound_create_from_buffer |
( |
uint8_t * | audio_data, |
|
|
const uint32_t | size, |
|
|
kinc_a1_audioformat_t | format ) |
Create a sound from a buffer.
- Parameters
-
| filename | Path to a wav file |
- Returns
- The newly created sound
◆ kinc_a1_sound_destroy()
| KINC_FUNC void kinc_a1_sound_destroy |
( |
kinc_a1_sound_t * | sound | ) |
|
Destroy a sound.
- Parameters
-
| sound | The sound to destroy. |
◆ kinc_a1_sound_set_volume()
| KINC_FUNC void kinc_a1_sound_set_volume |
( |
kinc_a1_sound_t * | sound, |
|
|
float | value ) |
Sets the volume-multiplicator that's used when playing the sound.
- Parameters
-
| sound | The sound to modify |
| value | The volume-multiplicator to set |
◆ kinc_a1_sound_volume()
| KINC_FUNC float kinc_a1_sound_volume |
( |
kinc_a1_sound_t * | sound | ) |
|
Gets the current volume-multiplicator that's used when playing the sound.
- Parameters
-
- Returns
- The volume-multiplicator