This repository has been archived on 2017-07-22. You can view files and clone it, but cannot push or open issues/pull-requests.
jlsampler/sample.h

22 lines
525 B
C

#ifndef sample_HEADER_
#define sample_HEADER_
#include "soundconfig.h"
typedef struct {
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.
} 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