Kore 3
Loading...
Searching...
No Matches
mixer.h
Go to the documentation of this file.
1#ifndef KORE_MIXER_HEADER
2#define KORE_MIXER_HEADER
3
4#include <kore3/global.h>
5
6#include "sound.h"
7#include "soundstream.h"
8
9#include <stdbool.h>
10
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19struct kore_internal_video_sound_stream;
20
21struct kore_mixer_stream_channel;
22typedef struct kore_mixer_stream_channel kore_mixer_stream_channel;
23
24struct kore_internal_video_channel;
25typedef struct kore_internal_video_channel kore_internal_video_channel;
26
27typedef struct kore_mixer_channel {
28 kore_mixer_sound *sound;
29 double position;
30 bool loop;
31 volatile float volume;
32 float pitch;
33 uint64_t generation;
35
39KORE_FUNC void kore_mixer_init(void);
40
51KORE_FUNC kore_mixer_channel *kore_mixer_play_sound(kore_mixer_sound *sound, bool loop, float volume, float pitch, bool unique);
52
58
64
70
77
84KORE_FUNC void kore_mixer_channel_set_volume(kore_mixer_channel *channel, float volume);
85
95KORE_FUNC void kore_mixer_mix(kore_audio_buffer *buffer, uint32_t samples);
96
97void kore_internal_play_video_sound_stream(struct kore_internal_video_sound_stream *stream);
98void kore_internal_stop_video_sound_stream(struct kore_internal_video_sound_stream *stream);
99
100#ifdef __cplusplus
101}
102#endif
103
104#endif
Provides basic functionality that's used all over the place. There's usually no need to manually incl...
KORE_FUNC void kore_mixer_stop_sound_stream(kore_mixer_sound_stream *stream)
Stops a sound-stream from playing.
KORE_FUNC void kore_mixer_mix(kore_audio_buffer *buffer, uint32_t samples)
Mixes audio into the provided buffer. kore_mixer_init sets this as the audio-callback but you can als...
KORE_FUNC float kore_mixer_channel_get_volume(kore_mixer_channel *channel)
Gets the current volume of a channel. Only works correctly if the channel is still playing.
KORE_FUNC void kore_mixer_channel_set_volume(kore_mixer_channel *channel, float volume)
Sets the current volume of a channel. Only works correctly if the channel is still playing.
KORE_FUNC void kore_mixer_play_sound_stream(kore_mixer_sound_stream *stream)
Starts playing a sound-stream.
KORE_FUNC void kore_mixer_stop_sound(kore_mixer_sound *sound)
Stops the sound from playing.
KORE_FUNC void kore_mixer_init(void)
Initialize the Mixer-API.
KORE_FUNC kore_mixer_channel * kore_mixer_play_sound(kore_mixer_sound *sound, bool loop, float volume, float pitch, bool unique)
Plays a sound immediately.
Sounds are pre-decoded on load and therefore primarily useful for playing sound-effects.
Sound-Streams are decoded while playing and as such are useful for large audio-files like music or sp...
Definition audio.h:18
Definition mixer.h:27
Definition soundstream.h:19
Definition sound.h:18