-
Notifications
You must be signed in to change notification settings - Fork 38
/
audio_conversion.h
47 lines (35 loc) · 909 Bytes
/
audio_conversion.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef AUDIO_CONVERSION_H
#define AUDIO_CONVERSION_H
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#include <sys/types.h>
#ifdef HAVE_SAMPLERATE
# include <samplerate.h>
#endif
#include "audio.h"
#ifdef __cplusplus
extern "C" {
#endif
struct audio_conversion
{
struct sound_params from;
struct sound_params to;
#ifdef HAVE_SAMPLERATE
SRC_STATE *src_state;
float *resample_buf;
size_t resample_buf_nsamples; /* in samples ( sizeof(float) ) */
#endif
};
int audio_conv_new (struct audio_conversion *conv,
const struct sound_params *from,
const struct sound_params *to);
char *audio_conv (struct audio_conversion *conv,
const char *buf, const size_t size, size_t *conv_len);
void audio_conv_destroy (struct audio_conversion *conv);
void audio_conv_bswap_16 (int16_t *buf, const size_t num);
void audio_conv_bswap_32 (int32_t *buf, const size_t num);
#ifdef __cplusplus
}
#endif
#endif