F~u~c~k i~t!
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
 
 

Display results as :
 


Rechercher Advanced Search

Top posting users this month
No user

GeoMap

Use the asynchronous AEC API of Speex with cautions! e.g. speex_echo_palyback() and speex_echo_capture()

Go down

Use the asynchronous  AEC API of Speex with cautions!  e.g. speex_echo_palyback() and speex_echo_capture()  Empty Use the asynchronous AEC API of Speex with cautions! e.g. speex_echo_palyback() and speex_echo_capture()

Post  halala Sat Aug 01, 2015 4:27 pm

The echo_diagnostic.m has bugs to run under both Octave and Matlab. I tried to info the developer community by the mailing list , but there seems no one is responsible for it.

The asynchronous AEC API speex_echo_palyback() and speex_echo_capture() is influence by a magic number
Code:

#define PLAYBACK_DELAY 2
Under most occasions, this number is not adequate. For example, your sound card may play 3 buffers before a captured buffer or vice vesa. This will cause the delay buffer over/under flow.

A side effect of this magic number is that it delays the play buf queue for 2 frames which may cause AEC mechanism not working at all. A simple work around, is call the speex_echo_capture() twice with empty buffers.
However, this solution is not apparent to most of developers who had not go through the source codes of Speex.


 And also the buffer filling scheme is strange, it append zeros at the end of input buffer rather than the head of it.
Code:

[b]668   if (st->play_buf_pos<=PLAYBACK_DELAY*st->frame_size)
[/b] 669   {
 670      int i;
 671      for (i=0;i<st->frame_size;i++)
 672         st->play_buf[st->play_buf_pos+i] = play[i];
 673      st->play_buf_pos += st->frame_size;
 674      if (st->play_buf_pos <= (PLAYBACK_DELAY-1)*st->frame_size)
 675      {
 676         speex_warning("Auto-filling the buffer (your application is buggy and/or got xruns)");
 677         for (i=0;i<st->frame_size;i++)
 678            st->play_buf[st->play_buf_pos+i] = play[i];
 679         st->play_buf_pos += st->frame_size;
 680      }
 681   } else {
[b] 682      speex_warning("Had to discard a playback frame (your application is buggy and/or got xruns)");
[/b]
683   }
halala
halala

帖子数 : 99
金币(Coin) : 4536
注册日期 : 2012-08-17

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum