blob: 712baafd2fa94defe954c1cb00a04e2a05e35045 [file] [log] [blame]
/************************************************************************
* °æÈ¨ËùÓÐ (C)2007,ÖÐÐËͨѶ¹É·ÝÓÐÏÞ¹«Ë¾¡£
* Ä£¿éÃû £º PCMÊý¾ÝÒôƵ²¥·ÅÄ£¿é
* ÎļþÃû³Æ£º Zte_pcmdriver.h
* Îļþ±êʶ£º
* ÄÚÈÝÕªÒª£º Ö÷Òª¶¨ÒåPCMÊý¾ÝÒôƵ²¥·ÅÄ£¿éµÄºê¶¨Òå¡¢³£Á¿¡¢È«¾Ö±äÁ¿ÒÔ¼°º¯ÊýµÄÉùÃ÷
* ´Ë½Ó¿ÚÖ÷ÒªÊÇÓÃÓڹ̶¨Ì¨ÓïÒô²¥±¨
*
* ÐÞ¸ÄÈÕÆÚ °æ±¾ºÅ Ð޸ıê¼Ç ÐÞ¸ÄÈË ÐÞ¸ÄÄÚÈÝ
* ----------------------------------------------------------------------
* 2010/01/13 1.0 Âíΰ ´´½¨
************************************************************************/
#ifndef ZTE_PCMDRIVER_H
#define ZTE_PCMDRIVER_H
#ifdef __cplusplus
extern "C"
{
#endif
/**************************************************************************
* Í·Îļþ°üº¬ *
**************************************************************************/
/**************************************************************************
* ³£Á¿ *
**************************************************************************/
typedef enum
{
PCM_MONO_CHANNEL,
PCM_DUAL_CHANNEL
}DD_PCM_CHANNEL;
typedef enum
{
PCM_VOL_LEV_0,
PCM_VOL_LEV_1,
PCM_VOL_LEV_2,
PCM_VOL_LEV_3,
PCM_VOL_LEV_4,
PCM_VOL_LEV_5
}DD_PCM_VOL_LEVEL;
typedef enum
{
DD_PCM_OUTPUT_RECEIVER = 1, /* ÌýͲ */
DD_PCM_OUTPUT_SPEAKER, /* ÑïÉùÆ÷ */
DD_PCM_OUTPUT_HEADPHONE, /* ¶ú»ú */
DD_PCM_OUTPUT_SPEAKER_HEADPHONE, /* ÑïÉùÆ÷ºÍ»°Í² */
DD_PCM_OUTPUT_BLUETOOTH /* À¶ÑÀ */
}DD_PCM_CHANNEL_OUTPUT;
typedef enum
{
DD_PCMRATE_8_KHZ = 0,
DD_PCMRATE_11_KHZ,
DD_PCMRATE_16_KHZ,
DD_PCMRATE_44_1_KHZ,
DD_PCMRATE_UNKNOW
}DD_PCM_SAMPLERATE;
/**************************************************************************
* ºê¶¨Òå *
**************************************************************************/
/**************************************************************************
* Êý¾ÝÀàÐÍ *
**************************************************************************/
typedef struct PCM_PLAY_PARAM_
{
DD_PCM_CHANNEL eChannel;
DD_PCM_VOL_LEVEL eVol;
DD_PCM_CHANNEL_OUTPUT eChannelOutput;
DD_PCM_SAMPLERATE eSampleRate;
}PCM_PLAY_PARAM;
/**************************************************************************
* È«¾Ö±äÁ¿ÉùÃ÷ *
**************************************************************************/
/**************************************************************************
* È«¾Öº¯ÊýÔ­ÐÍ *
**************************************************************************/
/**
* º¯ÊýÃû³Æ£º PCM_Audio_Init
* ¹¦ÄÜÃèÊö£º PCMÒôƵģ¿é³õʼ»¯
* ²ÎÊý˵Ã÷£º ÎÞ
* ·µ »Ø Öµ£º ´ò¿ªÉ豸³É¹¦·µ»Ø0;·ñÔò·µ»Ø-1¡£
* ÆäËü˵Ã÷£º
*/
SINT32 PCM_Audio_Init(void);
/**
* º¯ÊýÃû³Æ£º PCM_Audio_Release
* ¹¦ÄÜÃèÊö£º ÊÍ·ÅPCMÒôƵģ¿é
* ²ÎÊý˵Ã÷£º ÎÞ
* ·µ »Ø Öµ£º ÊÍ·ÅÉ豸³É¹¦·µ»Ø0;·ñÔò·µ»Ø-1¡£
* ÆäËü˵Ã÷£º
*/
SINT32 PCM_Audio_Release(void);
/**
* º¯ÊýÃû³Æ£º PCM_Audio_Open_Buffer
* ¹¦ÄÜÃèÊö£º ´ò¿ªPCMÊý¾Ýbuffer
* ²ÎÊý˵Ã÷£º ÎÞ
* ·µ »Ø Öµ£º ³É¹¦·µ»Ø0;·ñÔò·µ»Ø-1¡£
* ÆäËü˵Ã÷£º
*/
SINT32 PCM_Audio_Open_Buffer(PCM_PLAY_PARAM tPcmPlayParam, VOID *pPcmBuffer, UINT32 uiBufSize);
/**
* º¯ÊýÃû³Æ£º PCM_Audio_Play
* ¹¦ÄÜÃèÊö£º PCMÊý¾Ý¿ªÊ¼²¥·Å
* ²ÎÊý˵Ã÷£º ÎÞ
* ·µ »Ø Öµ£º ³É¹¦·µ»Ø0;·ñÔò·µ»Ø-1¡£
* ÆäËü˵Ã÷£º Óë³õʼ»¯º¯Êý³É¶ÔʹÓÃ
*/
SINT32 PCM_Audio_Play(UINT32 uiOffset, UINT32 uiRepeatCount);
/**
* º¯ÊýÃû³Æ£º PCM_Audio_Data_Input
* ¹¦ÄÜÃèÊö£º PCMÊý¾ÝÊäÈë
* ²ÎÊý˵Ã÷£º ÎÞ
* ·µ »Ø Öµ£º ³É¹¦·µ»Ø0;·ñÔò·µ»Ø-1¡£
* ÆäËü˵Ã÷£º Óë³õʼ»¯º¯Êý³É¶ÔʹÓÃ
*/
SINT32 PCM_Audio_Data_Input(VOID *pDataBuf, UINT32 uiDataLen);
/**
* º¯ÊýÃû³Æ£º PCM_Audio_Stop
* ¹¦ÄÜÃèÊö£º PCMÊý¾ÝÍ£Ö¹²¥·Å
* ²ÎÊý˵Ã÷£º (IN)ÎÞ
* ·µ »Ø Öµ£º ³É¹¦·µ»Ø0;·ñÔò·µ»Ø-1¡£
* ÆäËü˵Ã÷£º
*/
SINT32 PCM_Audio_Stop(VOID);
/**
* º¯ÊýÃû³Æ£º PCM_Audio_Close
* ¹¦ÄÜÃèÊö£º PCMÒôƵ²¥·ÅÄ£¿é¹Ø±Õ
* ²ÎÊý˵Ã÷£º (IN)ÎÞ
* ·µ »Ø Öµ£º ³É¹¦·µ»Ø0;·ñÔò·µ»Ø-1¡£
* ÆäËü˵Ã÷£º
*/
SINT32 PCM_Audio_Close(VOID);
#ifdef __cplusplus
}
#endif
#endif /* ZTE_PCMDRIVER_H */