twn_audio.c: .wav support and scratch channels
This commit is contained in:
@ -13,9 +13,12 @@
|
||||
|
||||
#define AUDIO_FREQUENCY 48000
|
||||
|
||||
|
||||
/* TODO: specify which PCM formats are usable with WAV */
|
||||
/* TODO: specify limitations of libxm */
|
||||
/* TODO: specify limitations of stb_vorbis */
|
||||
typedef enum AudioFileType {
|
||||
AUDIO_FILE_TYPE_OGG,
|
||||
AUDIO_FILE_TYPE_WAV,
|
||||
AUDIO_FILE_TYPE_XM,
|
||||
AUDIO_FILE_TYPE_COUNT,
|
||||
AUDIO_FILE_TYPE_UNKNOWN,
|
||||
@ -30,6 +33,12 @@ union AudioContext {
|
||||
uint8_t channel_count;
|
||||
} vorbis;
|
||||
|
||||
struct {
|
||||
void *samples;
|
||||
SDL_AudioSpec spec;
|
||||
size_t position;
|
||||
} wav;
|
||||
|
||||
struct {
|
||||
xm_context_t *handle;
|
||||
} xm;
|
||||
@ -44,6 +53,7 @@ typedef struct AudioChannel {
|
||||
bool repeat;
|
||||
float volume;
|
||||
float panning;
|
||||
bool finished;
|
||||
} AudioChannel;
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user