.ogg playback

This commit is contained in:
veclavtalica
2024-07-08 09:46:12 +03:00
parent adcf638e2a
commit 8a8f62dc25
12 changed files with 363 additions and 9 deletions

36
src/audio.h Normal file
View File

@@ -0,0 +1,36 @@
#ifndef AUDIO_H
#define AUDIO_H
#include <stdbool.h>
typedef struct play_audio_args {
/* default: false */
bool repeat;
/* crossfade between already playing audio on a given channel, if any */
/* default: false */
bool crossfade;
/* range: 0.0f to 1.0f */
/* default: 100.0f */
float volume;
/* range: -1.0 to 1.0f */
/* default: 0.0f */
float panning;
} t_play_audio_args;
/* plays audio file at specified channel or anywhere if NULL is passed */
/* path must contain valid file extension to infer which file format it is */
/* supported formats: .ogg, .xm */
/* preserves args that are already specified on the channel */
void play_audio(const char *path, const char *channel);
void play_audio_ex(const char *path, const char *channel, t_play_audio_args args);
void set_audio_args(const char *channel, t_play_audio_args args);
t_play_audio_args get_audio_args(const char *channel);
t_play_audio_args get_default_audio_args(void);
#endif