This repository has been archived on 2017-07-22. You can view files and clone it, but cannot push or open issues/pull-requests.
2017-07-22 09:04:10 +00:00
|
|
|
#ifndef sample_HEADER_
|
|
|
|
#define sample_HEADER_
|
|
|
|
|
|
|
|
#include "soundconfig.h"
|
|
|
|
|
|
|
|
typedef struct {
|
2017-07-22 18:16:41 +00:00
|
|
|
int len; // The number of samples in each channel.
|
|
|
|
int16_t *L; // Left channel.
|
|
|
|
int16_t *R; // Right channel.
|
|
|
|
double gain; // Gain to apply when converting back to float.
|
2017-07-22 09:04:10 +00:00
|
|
|
} Sample;
|
|
|
|
|
|
|
|
// Load a sample. Allocates.
|
|
|
|
void sample_load(Sample *s, char *path, SoundConfig *conf, int buf_size);
|
|
|
|
void sample_set_data(Sample *s, float *L, float *R, int len);
|
|
|
|
|
|
|
|
// Free a sample.
|
|
|
|
void sample_free(Sample *s);
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|