2

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

HarryHippo
  • 267
  • 1
  • 2
  • 9
  • I've worked with my code a bit, combining the capture and render threads into one. This helped with the synchronicity between rendering/capturing data, and processing the network side of it. I have actually gotten Speex to cancel a lot of echo, but now my problem lies with consistency. I'm beginning to think that WASAPI doesn't play well with Speex, in that it may occasionally have too much latency, which would screw with Speex AEC timing. – HarryHippo Nov 06 '13 at 00:23
  • Now my problem is that I get different results every time I run my application. I either get 1) Complete echo cancellation for a solid couple of minutes 2) Intermittent echo cancellation through the duration of the call, or 3) No echo cancellation from the get go. Unless anyone has anything to add or question, it may be time to pursue either another AEC or audio API for the winndows phone. – HarryHippo Nov 06 '13 at 00:25
  • How did you upsample ? Did you use any particular library? – Arctic Jun 10 '14 at 11:57
  • I just copied each byte 6 times. – HarryHippo Jun 11 '14 at 16:26

0 Answers0