下载Speex开源库编译https://www.speex.org/,不做详述!
//------------------------------头文件---------------------------------//
#ifndef SPEEX_EC_H
#define SPEEX_EC_H
#include <stdio.h>
#include <stdlib.h>
#include <speex/speex_echo.h>
#include <speex/speex_preprocess.h>
class CSpeexEC
{
public:
CSpeexEC();
~CSpeexEC();
void Init(int frame_size=160, int filter_length=1280, int sampling_rate=8000);
void DoAEC(short *mic, short *ref, short *out);
protected:
void Reset();
private:
bool m_bHasInit;
SpeexEchoState* m_pState;
SpeexPreprocessState* m_pPreprocessorState;
int m_nFrameSize;
int m_nFilterLen;
int m_nSampleRate;
spx_int32_t* m_pfNoise;
};
#endif
/
Speex AEC
最新推荐文章于 2021-01-12 13:49:04 发布
该博客介绍了如何利用Speex开源库编译并初始化回声消除(AEC)类,包括设置帧大小、滤波器长度和采样率,并展示了如何执行AEC操作。通过创建CSpeexEC类,调用speex_echo_state_init和speex_preprocess_state_init进行初始化,然后在DoAEC方法中执行回声消除。
摘要由CSDN通过智能技术生成