关于 g729a 实时编码
abolo 2008-12-09 11:22:15 http://topic.csdn.net/u/20081202/17/7cd20c83-ba9f-4636-8a78-acf45ca427b4.html
好不容易找到了 g729a 的编解码器
目前音频部分的采集已经完成,测试成功
现在想利用DirectShow的Samples中的NullNull对语音进行实时编码
HRESULT AAA::Transform(IMediaSample *pSample)
{
long *ptr_long = new long;
HRESULT hr;
*ptr_long = pSample->GetActualDataLength();
BYTE *bitstream;
hr = pSample->GetPointer(&bitstream);
if(FAILED(hr))
return hr;
short *speech = reinterpret_cast<short*>(ptr_long);
MessageBox(NULL, "Encoder", "beforeReceive", MB_OK);
va_g729a_encoder(speech, bitstream);//bitstream pointer pass what bitstream points to
MessageBox(NULL, "Encoder", "Receive", MB_OK);
pSample->GetPointer(&bitstream);
return NOERROR;
}
但运行一段时间后,程序就出错了.
"Test.exe 中的 0x0043a556 处未处理的异常: 0xC0000005: 读取位置 0x01a56000 时发生访问冲突 。"
代码停在va_g729a_encoder(speech, bitstream);上
==============
如果能提供测试例子,非常感谢,邮箱是qq80436683@yahoo.com.cn