35 lines
583 B
C
35 lines
583 B
C
// ampler.h
|
|
|
|
#define if if(
|
|
#define while while(
|
|
#define for for(
|
|
#define do )
|
|
|
|
typedef int8_t s8;
|
|
typedef int16_t s16;
|
|
typedef int32_t s32;
|
|
|
|
typedef uint8_t u8;
|
|
typedef uint16_t u16;
|
|
typedef uint32_t u32;
|
|
|
|
typedef float f32;
|
|
typedef double f64;
|
|
|
|
|
|
|
|
|
|
#define arraylen(a) (sizeof (a) / sizeof ((a)[0]))
|
|
|
|
#define SAMPLE_RATE (44100)
|
|
#define CHANNELS (2)
|
|
#define FRAME_SAMPLES (SAMPLE_RATE / 60)
|
|
|
|
typedef struct Ampler_state Ampler_state;
|
|
struct Ampler_state {
|
|
u32 size; // in bytes, off this struct
|
|
SDL_AudioDeviceID playdev;
|
|
s8 tracks[CHANNELS][SAMPLE_RATE * 480]; // 8 minutes
|
|
};
|
|
|