|
Kore 3
|
Mixer is a high-level audio-API that lets you directly play audio-files. More...
Go to the source code of this file.
Data Structures | |
| struct | kore_mixer_channel |
Typedefs | |
| typedef struct kore_mixer_stream_channel | kore_mixer_stream_channel |
| typedef struct kore_mixer_channel | kore_mixer_channel |
Functions | |
| 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. | |
| KORE_FUNC void | kore_mixer_stop_sound (kore_mixer_sound *sound) |
| Stops the sound from 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_stream (kore_mixer_sound_stream *stream) |
| Stops a sound-stream from playing. | |
| 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_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 also call it manually to mix with your own audio. To do that, first call kore_mixer_init, then call kore_audio_set_callback to set it to your own callback and call kore_mixer_mix from within that callback. Please be aware that the callback will run in a separate audio-thread. | |
Mixer is a high-level audio-API that lets you directly play audio-files.
| 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.
| channel | The channel to get the volume from |
| 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.
| channel | The channel to set the volume for |
| volume | The volume to set |
| 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 also call it manually to mix with your own audio. To do that, first call kore_mixer_init, then call kore_audio_set_callback to set it to your own callback and call kore_mixer_mix from within that callback. Please be aware that the callback will run in a separate audio-thread.
| buffer | The audio-buffer to be filled |
| samples | The number of samples to be filled in |
| 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.
| sound | The sound to play |
| loop | Whether or not to automatically loop the sound |
| volume | Scales the volume |
| pitch | Scales the pitch |
| unique | Makes sure that a sound is not played more than once at the same time |
| KORE_FUNC void kore_mixer_play_sound_stream | ( | kore_mixer_sound_stream * | stream | ) |
Starts playing a sound-stream.
| stream | The stream to play |
| KORE_FUNC void kore_mixer_stop_sound | ( | kore_mixer_sound * | sound | ) |
Stops the sound from playing.
| sound | The sound to stop |
| KORE_FUNC void kore_mixer_stop_sound_stream | ( | kore_mixer_sound_stream * | stream | ) |
Stops a sound-stream from playing.
| stream | The stream to stop. |