#if !defined(AFX_ACODEC_H__60F1B25F_8A2B_4405_A0A2_856A4ACADF78__INCLUDED_)
#define AFX_ACODEC_H__60F1B25F_8A2B_4405_A0A2_856A4ACADF78__INCLUDED_#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
 
#ifndef AVLIBDE_EXPORTS
#define AVLIBDE_EXPORTS
#define AVLIBDE_EXPORT __declspec(dllexport)
#endiftypedef enum _tag_AudioCodecType_
{
GSM = 0,
G726,
AUDIO_CODEC_NUM
} AUDIO_CODEC_TYPE;
class AVLIBDE_EXPORT CAudioCodecer
{
public :
CAudioCodecer(AUDIO_CODEC_TYPE codecerty=GSM);
~CAudioCodecer();
bool Open(bool bEncode);//true for encode,false for decode
void Close(); bool Encode(unsigned char * input, unsigned int inbufsize, unsigned char * output, unsigned int * outbufsize, int quality = 0);
bool Decode(unsigned char * input, unsigned int inbufsize, unsigned char * output, unsigned int * outbufsize);
bool GetCodecName(char * codecName, int & nameLength);
bool QueryType(AUDIO_CODEC_TYPE nCodecType);private:
AUDIO_CODEC_TYPE m_codecerty;};#endif