blob: 712baafd2fa94defe954c1cb00a04e2a05e35045 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/************************************************************************
2 * °æÈ¨ËùÓÐ (C)2007,ÖÐÐËͨѶ¹É·ÝÓÐÏÞ¹«Ë¾¡£
3 * Ä£¿éÃû £º PCMÊý¾ÝÒôƵ²¥·ÅÄ£¿é
4 * ÎļþÃû³Æ£º Zte_pcmdriver.h
5 * Îļþ±êʶ£º
6 * ÄÚÈÝÕªÒª£º Ö÷Òª¶¨ÒåPCMÊý¾ÝÒôƵ²¥·ÅÄ£¿éµÄºê¶¨Òå¡¢³£Á¿¡¢È«¾Ö±äÁ¿ÒÔ¼°º¯ÊýµÄÉùÃ÷
7 * ´Ë½Ó¿ÚÖ÷ÒªÊÇÓÃÓڹ̶¨Ì¨ÓïÒô²¥±¨
8 *
9 * ÐÞ¸ÄÈÕÆÚ °æ±¾ºÅ Ð޸ıê¼Ç ÐÞ¸ÄÈË ÐÞ¸ÄÄÚÈÝ
10 * ----------------------------------------------------------------------
11 * 2010/01/13 1.0 Âíΰ ´´½¨
12 ************************************************************************/
13
14#ifndef ZTE_PCMDRIVER_H
15#define ZTE_PCMDRIVER_H
16
17#ifdef __cplusplus
18extern "C"
19{
20#endif
21
22/**************************************************************************
23 * Í·Îļþ°üº¬ *
24 **************************************************************************/
25
26/**************************************************************************
27 * ³£Á¿ *
28 **************************************************************************/
29typedef enum
30{
31 PCM_MONO_CHANNEL,
32 PCM_DUAL_CHANNEL
33}DD_PCM_CHANNEL;
34
35typedef enum
36{
37 PCM_VOL_LEV_0,
38 PCM_VOL_LEV_1,
39 PCM_VOL_LEV_2,
40 PCM_VOL_LEV_3,
41 PCM_VOL_LEV_4,
42 PCM_VOL_LEV_5
43}DD_PCM_VOL_LEVEL;
44
45typedef enum
46{
47 DD_PCM_OUTPUT_RECEIVER = 1, /* ÌýͲ */
48 DD_PCM_OUTPUT_SPEAKER, /* ÑïÉùÆ÷ */
49 DD_PCM_OUTPUT_HEADPHONE, /* ¶ú»ú */
50 DD_PCM_OUTPUT_SPEAKER_HEADPHONE, /* ÑïÉùÆ÷ºÍ»°Í² */
51 DD_PCM_OUTPUT_BLUETOOTH /* À¶ÑÀ */
52}DD_PCM_CHANNEL_OUTPUT;
53
54typedef enum
55{
56 DD_PCMRATE_8_KHZ = 0,
57 DD_PCMRATE_11_KHZ,
58 DD_PCMRATE_16_KHZ,
59 DD_PCMRATE_44_1_KHZ,
60 DD_PCMRATE_UNKNOW
61}DD_PCM_SAMPLERATE;
62
63/**************************************************************************
64 * ºê¶¨Òå *
65 **************************************************************************/
66
67/**************************************************************************
68 * Êý¾ÝÀàÐÍ *
69 **************************************************************************/
70typedef struct PCM_PLAY_PARAM_
71{
72 DD_PCM_CHANNEL eChannel;
73 DD_PCM_VOL_LEVEL eVol;
74 DD_PCM_CHANNEL_OUTPUT eChannelOutput;
75 DD_PCM_SAMPLERATE eSampleRate;
76}PCM_PLAY_PARAM;
77
78
79/**************************************************************************
80 * È«¾Ö±äÁ¿ÉùÃ÷ *
81 **************************************************************************/
82
83/**************************************************************************
84 * È«¾Öº¯ÊýÔ­ÐÍ *
85 **************************************************************************/
86/**
87 * º¯ÊýÃû³Æ£º PCM_Audio_Init
88 * ¹¦ÄÜÃèÊö£º PCMÒôƵģ¿é³õʼ»¯
89 * ²ÎÊý˵Ã÷£º ÎÞ
90 * ·µ »Ø Öµ£º ´ò¿ªÉ豸³É¹¦·µ»Ø0;·ñÔò·µ»Ø-1¡£
91 * ÆäËü˵Ã÷£º
92 */
93SINT32 PCM_Audio_Init(void);
94
95/**
96 * º¯ÊýÃû³Æ£º PCM_Audio_Release
97 * ¹¦ÄÜÃèÊö£º ÊÍ·ÅPCMÒôƵģ¿é
98 * ²ÎÊý˵Ã÷£º ÎÞ
99 * ·µ »Ø Öµ£º ÊÍ·ÅÉ豸³É¹¦·µ»Ø0;·ñÔò·µ»Ø-1¡£
100 * ÆäËü˵Ã÷£º
101 */
102SINT32 PCM_Audio_Release(void);
103
104/**
105 * º¯ÊýÃû³Æ£º PCM_Audio_Open_Buffer
106 * ¹¦ÄÜÃèÊö£º ´ò¿ªPCMÊý¾Ýbuffer
107 * ²ÎÊý˵Ã÷£º ÎÞ
108 * ·µ »Ø Öµ£º ³É¹¦·µ»Ø0;·ñÔò·µ»Ø-1¡£
109 * ÆäËü˵Ã÷£º
110 */
111SINT32 PCM_Audio_Open_Buffer(PCM_PLAY_PARAM tPcmPlayParam, VOID *pPcmBuffer, UINT32 uiBufSize);
112
113/**
114 * º¯ÊýÃû³Æ£º PCM_Audio_Play
115 * ¹¦ÄÜÃèÊö£º PCMÊý¾Ý¿ªÊ¼²¥·Å
116 * ²ÎÊý˵Ã÷£º ÎÞ
117 * ·µ »Ø Öµ£º ³É¹¦·µ»Ø0;·ñÔò·µ»Ø-1¡£
118 * ÆäËü˵Ã÷£º Óë³õʼ»¯º¯Êý³É¶ÔʹÓÃ
119 */
120SINT32 PCM_Audio_Play(UINT32 uiOffset, UINT32 uiRepeatCount);
121
122/**
123 * º¯ÊýÃû³Æ£º PCM_Audio_Data_Input
124 * ¹¦ÄÜÃèÊö£º PCMÊý¾ÝÊäÈë
125 * ²ÎÊý˵Ã÷£º ÎÞ
126 * ·µ »Ø Öµ£º ³É¹¦·µ»Ø0;·ñÔò·µ»Ø-1¡£
127 * ÆäËü˵Ã÷£º Óë³õʼ»¯º¯Êý³É¶ÔʹÓÃ
128 */
129SINT32 PCM_Audio_Data_Input(VOID *pDataBuf, UINT32 uiDataLen);
130
131/**
132 * º¯ÊýÃû³Æ£º PCM_Audio_Stop
133 * ¹¦ÄÜÃèÊö£º PCMÊý¾ÝÍ£Ö¹²¥·Å
134 * ²ÎÊý˵Ã÷£º (IN)ÎÞ
135 * ·µ »Ø Öµ£º ³É¹¦·µ»Ø0;·ñÔò·µ»Ø-1¡£
136 * ÆäËü˵Ã÷£º
137 */
138SINT32 PCM_Audio_Stop(VOID);
139
140/**
141 * º¯ÊýÃû³Æ£º PCM_Audio_Close
142 * ¹¦ÄÜÃèÊö£º PCMÒôƵ²¥·ÅÄ£¿é¹Ø±Õ
143 * ²ÎÊý˵Ã÷£º (IN)ÎÞ
144 * ·µ »Ø Öµ£º ³É¹¦·µ»Ø0;·ñÔò·µ»Ø-1¡£
145 * ÆäËü˵Ã÷£º
146 */
147SINT32 PCM_Audio_Close(VOID);
148
149#ifdef __cplusplus
150}
151#endif
152
153#endif /* ZTE_PCMDRIVER_H */
154