/*silkcodec
头文件
*/
/*
*
QQ: 617242746
*
Developer: yu
*
Time: 2013.4.16
*/
#ifndef _SILKCODEC_H_
#define _SILKCODEC_H_
#include "interface/SKP_Silk_SDK_API.h"
#include
#include
#pragma comment(lib,"silk.lib")
#define MAX_BYTES_PRE_FRAME 250
#define MAX_INPUT_FRAME 5
#define MAX_API_FS_KHZ 48
#define FRAME_LENGTH_MS 20
#define SAFE_DELETE_ELEMENT(hp) if(hp != NULL){delete hp; hp = NULL;}
class SilkEncoder
{
public:
SilkEncoder();
~SilkEncoder();
void InitEncoder();
void SetEncoderParameter();
void CreateEncoder();
void
StartEncoder(const
SKP_int16*
samplesIn,
SKP_int
counter
,
SKP_uint8** samplesOut, SKP_int16* bytesOut);
private:
SKP_SILK_SDK_EncControlStruct m_encControl;
SKP_SILK_SDK_EncControlStruct m_encStatus;
char* m_psEnc;
SKP_int32 m_enSizeBytesEncode;
//
SKP_int16 in[FRAME_LENGTH_MS * MAX_API_FS_KHZ * MAX_INPUT_FRAME];
SKP_uint8* m_payloadEncode;
SKP_int16 m_nBytesEncode;
/*param*/
SKP_int m_packetSize_ms;
SKP_int m_API_fs_Hz;
SKP_int m_bitRate;