summaryrefslogtreecommitdiffstats
path: root/libtoolame-dab/toolame.h
blob: 998ac4ffdea9377a89ae9ef19d8c5e0f7c661d1a (plain)
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
48
49
50
51
52
/*! \section libtoolame API
 *  \file toolame.h
 *  \brief The libtoolame API
 */
#ifndef __TOOLAME_H_
#define __TOOLAME_H_
#include <stdlib.h>

/*! All exported functions shown here return zero
 * on success */

/*! Initialise toolame encoding library. */
int toolame_init(void);

/*! Finish encoding the pending samples.
 *
 * \return number of bytes written to output_buffer
 */
int toolame_finish(
        unsigned char *output_buffer,
        size_t output_buffer_size);

int toolame_enable_downmix_stereo(void);
int toolame_enable_byteswap(void);

/*! Set channel mode. Allowed values:
 * s, d, j, and m
 */
int toolame_set_channel_mode(const char mode);

/*! Valid PSY models: 0 to 3 */
int toolame_set_psy_model(int new_model);

int toolame_set_bitrate(int brate);

/*! Set sample rate in Hz */
int toolame_set_samplerate(long sample_rate);

/*! Enable PAD insertion from the specified file with length */
int toolame_set_pad(int pad_len);

/*! Encodes one frame. Returns number of bytes written to output_buffer
 */
int toolame_encode_frame(
        short buffer[2][1152],
        unsigned char *xpad_data,
        size_t xpad_len,
        unsigned char *output_buffer,
        size_t output_buffer_size);

#endif // __TOOLAME_H_