Bitcrusher

This commit is contained in:
2022-07-12 20:43:02 +00:00
parent 37d6b64bb9
commit 4896bc5e52
9 changed files with 6184 additions and 37 deletions

View File

@@ -26,20 +26,28 @@ struct soundstream soundstream_make();
struct sound {
int loop;
int frame;
int playing;
float gain;
struct wav *data;
struct bus *bus;
};
struct wav {
unsigned int ch;
unsigned int samplerate;
unsigned int frames;
float gain;
float gain; /* In dB */
void *data;
};
struct soundstream {
SDL_AudioStream *srconv;
void *data;
};
struct music {
};
@@ -53,9 +61,22 @@ void audio_close();
void sound_fillbuf(struct sound *s, short *buf, int n);
struct wav make_sound(const char *wav);
struct sound *make_music(const char *ogg);
void wav_norm_gain(struct wav *w, double lv);
struct sound play_sound(struct wav *wav);
int sound_playing(struct sound *s);
int sound_paused(struct sound *s);
int sound_stopped(struct sound *s);
int sound_finished(struct sound *s);
void sound_pause(struct sound *s);
void sound_resume(struct sound *s);
void sound_stop(struct sound *s);
struct music make_music(const char *ogg);
void play_sound(struct wav wav);
const char *get_audio_driver();
@@ -67,9 +88,11 @@ int open_device(const char *adriver);
float short2db(short val);
short db2short(float db);
float pct2db(float pct);
short short_gain(short val, float db);
float pct2db(float pct);
float pct2mult(float pct);
void audio_init();