-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaudio_conversion.h
More file actions
44 lines (33 loc) · 790 Bytes
/
audio_conversion.h
File metadata and controls
44 lines (33 loc) · 790 Bytes
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
#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);
#ifdef __cplusplus
}
#endif
#endif