예제 #1
0
파일: aec.c 프로젝트: biddyweb/azfone-ios
static void webrtc_aec_postprocess(MSFilter *f)
{
	WebRTCAECState *s = (WebRTCAECState *) f->data;

	ms_bufferizer_flush(&s->delayed_ref);
	ms_bufferizer_flush(&s->echo);
	ms_bufferizer_flush(&s->ref);
	if (s->aecmInst != NULL) {
		WebRtcAecm_Free(s->aecmInst);
		s->aecmInst = NULL;
	}
}
예제 #2
0
int main(void){
    void *aecInst;
    if(-1 == WebRtcAecm_Create(&aecInst)){
        perror("WebRtcAec_Create:");
        exit(1);
    }
    if(-1 == WebRtcAecm_Init(aecInst,8000)){
        perror("WebRtcAec_Init:");
        exit(1);
    }
    WebRtcAecm_Free(aecInst);

    printf("hello webRTC\n");
    return 0;
}
예제 #3
0
파일: KotiAEC.cpp 프로젝트: aichew/KOTI_AEC
void KotiAEC_destory()
{
    if(speex_aec_pty.speex_echo_state != NULL && speex_aec_pty.speex_preprocess_state != NULL)
    {
        speex_echo_state_destroy((SpeexEchoState*)speex_aec_pty.speex_echo_state);
        speex_preprocess_state_destroy((SpeexPreprocessState*)speex_aec_pty.speex_preprocess_state);

        if(speex_aec_pty.speex_preprocess_state_tmp)
            speex_preprocess_state_destroy((SpeexPreprocessState*)speex_aec_pty.speex_preprocess_state_tmp);

        if(speex_aec_pty.nosie)
            free(speex_aec_pty.nosie);

        speex_aec_pty.speex_echo_state = NULL;
        speex_aec_pty.speex_preprocess_state = NULL;
        speex_aec_pty.speex_preprocess_state_tmp = NULL;
        speex_aec_pty.frame_size = 0;
        speex_aec_pty.sample_freq = 0;
        speex_aec_pty.filter_length = 0;
        speex_aec_pty.nosie = NULL;
    }

#ifdef WEBRTC_AEC_CORE_ENABLED
    if(webrtc_aec_pty.webrtc_aec != NULL)
    {
        WebRtcAec_Free(webrtc_aec_pty.webrtc_aec);
        webrtc_aec_pty.webrtc_aec = NULL;
        webrtc_aec_pty.frame_size = 0;
        webrtc_aec_pty.sample_freq = 0;
        webrtc_aec_pty.sndcard_sample_freq = 0;

        if(webrtc_aec_pty.webrtc_ns)
        {
            WebRtcNsx_Free((NsxHandle*)webrtc_aec_pty.webrtc_ns);
            webrtc_aec_pty.webrtc_ns = NULL;
        }
        if(webrtc_aec_pty.webrtc_agc)
        {
            WebRtcAgc_Free(webrtc_aec_pty.webrtc_agc);
            webrtc_aec_pty.webrtc_agc = NULL;
        }
    }

    if(webrtc_aecm_pty.webrtc_aec != NULL)
    {
        WebRtcAecm_Free(webrtc_aecm_pty.webrtc_aec);
        webrtc_aecm_pty.webrtc_aec = NULL;
        webrtc_aecm_pty.frame_size = 0;
        webrtc_aecm_pty.sample_freq = 0;
        webrtc_aecm_pty.sndcard_sample_freq = 0;

        if(webrtc_aecm_pty.webrtc_ns)
        {
            WebRtcNsx_Free((NsxHandle*)webrtc_aecm_pty.webrtc_ns);
            webrtc_aecm_pty.webrtc_ns = NULL;
        }
        if(webrtc_aecm_pty.webrtc_agc)
        {
            WebRtcAgc_Free(webrtc_aecm_pty.webrtc_agc);
            webrtc_aecm_pty.webrtc_agc = NULL;
        }
    }
#endif
}