资源简介

vs2010 编译,即可运行

资源截图

代码片段和文件信息

#include “StdAfx.h“
#include “AudioCode.h“


extern “C“ void va_g729a_init_encoder();
extern “C“ void va_g729a_encoder(short *speech unsigned char *bitstream);
extern “C“ void va_g729a_init_decoder();
extern “C“ void va_g729a_decoder(unsigned char *bitstream short *synth_short int bfi);

#define  L_frame_COMPRESSED 10
#define  L_frame            80

#pragma comment(lib“G729a“)

CAudioCode::CAudioCode()
{
va_g729a_init_encoder();
va_g729a_init_decoder();
}

CAudioCode::~CAudioCode()
{
}

BOOL CAudioCode::EncodeAudioData(char *pinint lenchar* poutint* lenr)
{
BOOL bRet=FALSE;
if(!pin||len!=SIZE_AUDIO_frame||!pout)
return bRet;

va_g729a_encoder((short*)pin(BYTE*)pout);
va_g729a_encoder((short*)(pin+160)(BYTE*)pout+10);
va_g729a_encoder((short*)(pin+320)(BYTE*)pout+20);
va_g729a_encoder((short*)(pin+480)(BYTE*)pout+30);
va_g729a_encoder((short*)(pin+640)(BYTE*)pout+40);
va_g729a_encoder((short*)(pin+800)(BYTE*)pout+50);

if(lenr)
*lenr=SIZE_AUDIO_PACKED;

bRet=TRUE;
}

BOOL CAudioCode::DecodeAudioData(char *pinint lenchar* poutint* lenr)
{
BOOL bRet=FALSE;
if(!pin||len!=SIZE_AUDIO_PACKED||!pout)
return bRet;

va_g729a_decoder((BYTE*)pin(short*)(pout)0);
va_g729a_decoder((BYTE*)pin+10(short*)(pout+160)0);
va_g729a_decoder((BYTE*)pin+20(short*)(pout+320)0);
va_g729a_decoder((BYTE*)pin+30(short*)(pout+480)0);
va_g729a_decoder((BYTE*)pin+40(short*)(pout+640)0);
va_g729a_decoder((BYTE*)pin+50(short*)(pout+800)0);

if(lenr)
*lenr=SIZE_AUDIO_frame;

bRet=TRUE;
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件    6484992  2013-10-21 11:06  voice\Debug\voice.exe

     文件   15120000  2013-10-21 11:06  voice\Debug\voice.ilk

     文件   26643456  2013-10-21 11:06  voice\Debug\voice.pdb

     文件   88276992  2013-10-21 11:05  voice\ipch\voice-5cf2bc0a\voice-a8a9d502.ipch

     文件       1594  2013-07-07 23:41  voice\voice\AudioCode.cpp

     文件        340  2013-07-06 14:14  voice\voice\AudioCode.h

     文件       8653  2013-10-21 09:43  voice\voice\Debug\AudioCode.obj

     文件      43938  2013-10-21 11:06  voice\voice\Debug\cl.command.1.tlog

     文件     268360  2013-10-21 11:06  voice\voice\Debug\CL.read.1.tlog

     文件      37554  2013-10-21 11:06  voice\voice\Debug\CL.write.1.tlog

     文件      19891  2013-07-08 13:25  voice\voice\Debug\ClientSocket.obj

     文件      43137  2013-10-21 09:43  voice\voice\Debug\Interface.obj

     文件          2  2013-10-21 11:06  voice\voice\Debug\link-cvtres.read.1.tlog

     文件          2  2013-10-21 11:06  voice\voice\Debug\link-cvtres.write.1.tlog

     文件          2  2013-10-21 11:06  voice\voice\Debug\link.3688-cvtres.read.1.tlog

     文件          2  2013-10-21 11:06  voice\voice\Debug\link.3688-cvtres.write.1.tlog

     文件          2  2013-10-21 11:06  voice\voice\Debug\link.3688.read.1.tlog

     文件          2  2013-10-21 11:06  voice\voice\Debug\link.3688.write.1.tlog

     文件          2  2013-10-21 11:06  voice\voice\Debug\link.4528-cvtres.read.1.tlog

     文件          2  2013-10-21 11:06  voice\voice\Debug\link.4528-cvtres.write.1.tlog

     文件          2  2013-10-21 11:06  voice\voice\Debug\link.4528.read.1.tlog

     文件          2  2013-10-21 11:06  voice\voice\Debug\link.4528.write.1.tlog

     文件          2  2013-10-21 11:06  voice\voice\Debug\link.5956-cvtres.read.1.tlog

     文件          2  2013-10-21 11:06  voice\voice\Debug\link.5956-cvtres.write.1.tlog

     文件          2  2013-10-21 11:06  voice\voice\Debug\link.5956.read.1.tlog

     文件          2  2013-10-21 11:06  voice\voice\Debug\link.5956.write.1.tlog

     文件          2  2013-10-21 11:06  voice\voice\Debug\link.7024-cvtres.read.1.tlog

     文件          2  2013-10-21 11:06  voice\voice\Debug\link.7024-cvtres.write.1.tlog

     文件          2  2013-10-21 11:06  voice\voice\Debug\link.7024.read.1.tlog

     文件          2  2013-10-21 11:06  voice\voice\Debug\link.7024.write.1.tlog

............此处省略90个文件信息

评论

共有 条评论