Initial commit

This commit is contained in:
mid
2025-01-19 17:29:52 +02:00
commit 49c44fe87c
31 changed files with 38962 additions and 0 deletions

50
src/k3mix.h Normal file
View File

@@ -0,0 +1,50 @@
#pragma once
#include<stdint.h>
#include<stddef.h>
#include<stdbool.h>
struct k3MixWave;
typedef intmax_t(*k3MixWaveReadFunc)(struct k3MixWave *dis, size_t sampleCount, float *buf);
typedef void(*k3MixWaveCloseFunc)(struct k3MixWave *dis);
typedef void(*k3MixWaveCloneFunc)(struct k3MixWave *dis, struct k3MixWave *destination);
struct k3MixSource;
struct k3MixSource *k3MixSourceFile(const char *path);
void k3MixSourceClose(struct k3MixSource*);
struct k3MixWave {
size_t refs;
uint32_t sampleRate;
uint8_t channels;
void *data;
k3MixWaveReadFunc read;
k3MixWaveCloseFunc close;
k3MixWaveCloneFunc clone;
// All the cool things
bool loop;
bool end;
uint16_t dam;
float volume;
};
void k3MixInit(uint32_t sampleRate, uint8_t channels);
struct k3MixWave *k3MixSimple(struct k3MixSource*);
void k3MixSimpleSeek(struct k3MixWave*, double t);
struct k3MixWave *k3MixQueue();
void k3MixQueueAdd(struct k3MixWave *this, struct k3MixWave *child);
void k3MixQueueClear(struct k3MixWave *this);
struct k3MixWave *k3MixPowerMeasurement(struct k3MixWave *child);
float k3MixPowerMeasurementGetRMS(struct k3MixWave*);
void k3MixStop(struct k3MixWave*);
struct k3MixWave *k3MixPlay(struct k3MixWave*);
void k3MixPlayDirect(struct k3MixWave*);
void k3MixPortAudio();