Commit e8c8d325 authored by Simon Morlat's avatar Simon Morlat

add 2 options to control echo canceller from mediastream program

parent 6f2612b0
......@@ -69,6 +69,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define MS_VOLUME_SET_EA_TRANSMIT_THRESHOLD MS_FILTER_METHOD(MS_VOLUME_ID,17,float)
#define MS_VOLUME_MIN_ENERGY_DB (-120) /*arbitrary value returned when linear energy is 0*/
extern MSFilterDesc ms_volume_desc;
#endif
......@@ -116,6 +116,7 @@ static void volume_uninit(MSFilter *f){
}
static inline float linear_to_db(float linear){
if (linear==0) return MS_VOLUME_MIN_ENERGY_DB;
return 10*ortp_log10f(linear);
}
......
......@@ -52,7 +52,7 @@ static bool_t use_ng=FALSE;
static bool_t two_windows=FALSE;
/* starting values echo canceller */
static int ec_len_ms=0, ec_delay_ms=250, ec_framesize;
static int ec_len_ms=0, ec_delay_ms=0, ec_framesize=0;
static void stop_handler(int signum)
......@@ -142,6 +142,8 @@ const char *usage="mediastream --local <port> --remote <ip:port> --payload <payl
"[ --height <pixels> ]\n"
"[ --bitrate <bits per seconds>]\n"
"[ --ec (enable echo canceller)]\n"
"[ --ec-tail <echo canceller tail length in ms> ]\n"
"[ --ec-delay <echo canceller delay in ms> ]\n"
"[ --agc (enable automatic gain control)]\n"
"[ --ng (enable noise gate)]\n"
"[ --ng-threshold <(float) [0-1]> (noise gate threshold)]\n"
......@@ -227,6 +229,12 @@ int main(int argc, char * argv[])
playback_card=argv[i];
}else if (strcmp(argv[i],"--ec")==0){
ec=TRUE;
}else if (strcmp(argv[i],"--ec-tail")==0){
i++;
ec_len_ms=atoi(argv[i]);
}else if (strcmp(argv[i],"--ec-delay")==0){
i++;
ec_delay_ms=atoi(argv[i]);
}else if (strcmp(argv[i],"--agc")==0){
agc=TRUE;
}else if (strcmp(argv[i],"--eq")==0){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment