Speex AEC on WP8

460 Views Asked by At

I'm working on a VoIP application for Windows Phone 8, and I want to cancel the echo produced when using speakerphone. Speex offers an AEC module, which I have tried to integrate into my application, but to no avail. My application works fine, but the echo persists. My code is based off the MS Chatterbox VoIP application, using WASAPI for capture and render. This is the form of the relevant sections (I tried to indicate what already existed and worked, and what was new):

Init:

// I've tried tail lengths between 100-500ms (800-4000 samples @ 8KHz)
echoState = speex_echo_state_init (80, 800) 
speex_echo_ctl(echoState, SPEEX_ECHO_SET_SAMPLING_RATE, 8000);

Render (runs every 10ms):

Read 10ms (80 samples) data from network (8KHz, 16 bit, mono)

NEW - speex_echo_playback(echoState, networkData)

Upsample data to 48KHz
Render data

Capture (runs every 10ms):

Capture 10ms of data (48KHz, 16 bit, mono)
Downsample to 8KHz

NEW - speex_echo_capture(echoState, downsampledData, echoCancelledData)

Send echoCancelledData to network

After reading the Speex documentation and looking at some posts on this site (not a lot of speex for Wp8 questions, but a few for android), I'm under the impression that this is, or is close to, the proper implementatinon of their API. So why isn't it working?

Thanks in advance

0

There are 0 best solutions below