-
Notifications
You must be signed in to change notification settings - Fork 14
/
EasyAACEncoderAPI.h
80 lines (66 loc) · 1.91 KB
/
EasyAACEncoderAPI.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
Copyright (c) 2013-2019 EasyDarwin.ORG. All rights reserved.
Github: https://github.com/EasyDarwin
WEChat: EasyDarwin
Website: http://www.easydarwin.org
*/
#ifndef EasyAACEncoder_API_H
#define EasyAACEncoder_API_H
#ifdef _WIN32
#define Easy_API __declspec(dllexport)
#define Easy_APICALL __stdcall
#else
#define Easy_API
#define Easy_APICALL
#endif
#define Easy_Handle void*
///* Audio Codec */
enum Law
{
Law_ULaw = 0, /**< U law */
Law_ALaw = 1, /**< A law */
Law_PCM16 = 2, /**< 16 bit uniform PCM values. original pcm data */
Law_G726 = 3 /**< G726 */
};
///* Rate Bits */
enum Rate
{
Rate16kBits=2, /**< 16k bits per second (2 bits per ADPCM sample) */
Rate24kBits=3, /**< 24k bits per second (3 bits per ADPCM sample) */
Rate32kBits=4, /**< 32k bits per second (4 bits per ADPCM sample) */
Rate40kBits=5 /**< 40k bits per second (5 bits per ADPCM sample) */
};
typedef struct _g711param
{
;
}G711Param;
typedef struct _g726param
{
unsigned char ucRateBits;//Rate16kBits Rate24kBits Rate32kBits Rate40kBits
}G726Param;
typedef struct _initParam
{
unsigned char ucAudioCodec; // Law_uLaw Law_ALaw Law_PCM16 Law_G726
unsigned char ucAudioChannel; //1
unsigned int u32AudioSamplerate; //8000
unsigned int u32PCMBitSize; //16
union
{
G711Param g711param;
G726Param g726param;
};
}InitParam;
#ifdef __cplusplus
extern "C"
{
#endif
/* Create AAC Encoder Handle */
Easy_API Easy_Handle Easy_APICALL Easy_AACEncoder_Init(InitParam initPar);
/* Input original data, output the encoede AAC data */
Easy_API int Easy_APICALL Easy_AACEncoder_Encode(Easy_Handle handle, unsigned char* inbuf, unsigned int inlen, unsigned char* outbuf, unsigned int* outlen);
/* Close Encoder Handle */
Easy_API void Easy_APICALL Easy_AACEncoder_Release(Easy_Handle handle);
#ifdef __cplusplus
}
#endif
#endif /* EasyAACEncoder_API_H */