diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 5e0555bc7..2de23d239 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -620,8 +620,8 @@ static void sound_config_read(LinphoneCore *lc) linphone_core_enable_agc(lc, lp_config_get_int(lc->config,"sound","agc",0)); - gain=lp_config_get_float(lc->config,"sound","soft_play_lev",0); - linphone_core_set_soft_play_level(lc,gain); + gain=lp_config_get_float(lc->config,"sound","playback_gain_db",0); + linphone_core_set_playback_gain_db (lc,gain); } static void sip_config_read(LinphoneCore *lc) @@ -2241,14 +2241,19 @@ static void parametrize_equalizer(LinphoneCore *lc, AudioStream *st){ static void post_configure_audio_streams(LinphoneCore *lc){ AudioStream *st=lc->audiostream; - float mic_gain=lp_config_get_float(lc->config,"sound","mic_gain",-1); + float mic_gain=lp_config_get_float(lc->config,"sound","mic_gain",1); float thres = 0; + float recv_gain; + float ng_thres=lp_config_get_float(lc->config,"sound","ng_thres",0.05); + float ng_floorgain=lp_config_get_float(lc->config,"sound","ng_floorgain",0); + if (mic_gain!=-1) audio_stream_set_mic_gain(st,mic_gain); lc->audio_muted=FALSE; - float recv_gain = lc->sound_conf.soft_play_lev; + + recv_gain = lc->sound_conf.soft_play_lev; if (recv_gain != 0) { - linphone_core_set_soft_play_level(lc,recv_gain); + linphone_core_set_playback_gain_db (lc,recv_gain); } if (linphone_core_echo_limiter_enabled(lc)){ float speed=lp_config_get_float(lc->config,"sound","el_speed",-1); @@ -2262,14 +2267,13 @@ static void post_configure_audio_streams(LinphoneCore *lc){ if (force==-1) force=25; ms_filter_call_method(f,MS_VOLUME_SET_EA_SPEED,&speed); ms_filter_call_method(f,MS_VOLUME_SET_EA_FORCE,&force); - if (thres!=-1) - ms_filter_call_method(f,MS_VOLUME_SET_EA_THRESHOLD,&thres); - if (sustain!=-1) - ms_filter_call_method(f,MS_VOLUME_SET_EA_SUSTAIN,&sustain); + if (thres!=-1) + ms_filter_call_method(f,MS_VOLUME_SET_EA_THRESHOLD,&thres); + if (sustain!=-1) + ms_filter_call_method(f,MS_VOLUME_SET_EA_SUSTAIN,&sustain); + } } - } - float ng_thres=lp_config_get_float(lc->config,"sound","ng_thres",0.05); - float ng_floorgain=lp_config_get_float(lc->config,"sound","ng_floorgain",0); + if (st->volsend){ ms_filter_call_method(st->volsend,MS_VOLUME_SET_NOISE_GATE_THRESHOLD,&ng_thres); ms_filter_call_method(st->volsend,MS_VOLUME_SET_NOISE_GATE_FLOORGAIN,&ng_floorgain); @@ -2673,13 +2677,13 @@ void linphone_core_set_ring_level(LinphoneCore *lc, int level){ } /** - * Sets call playback gain in db + * Allow to control play level before entering sound card: gain in db * * @ingroup media_parameters **/ -void linphone_core_set_soft_play_level(LinphoneCore *lc, float level){ - float gain=level; - lc->sound_conf.soft_play_lev=level; +void linphone_core_set_playback_gain_db (LinphoneCore *lc, float gaindb){ + float gain=gaindb; + lc->sound_conf.soft_play_lev=gaindb; AudioStream *st=lc->audiostream; if (!st) return; /*just return*/ @@ -2689,11 +2693,11 @@ void linphone_core_set_soft_play_level(LinphoneCore *lc, float level){ } /** - * Returns call playback gain in db + * Get playback gain in db before entering sound card. * * @ingroup media_parameters **/ -float linphone_core_get_soft_play_level(LinphoneCore *lc) { +float linphone_core_get_playback_gain_db(LinphoneCore *lc) { float gain=0; AudioStream *st=lc->audiostream; if (st->volrecv){ diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 87305e449..28ad13587 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -675,18 +675,10 @@ int linphone_core_get_play_level(LinphoneCore *lc); int linphone_core_get_rec_level(LinphoneCore *lc); void linphone_core_set_ring_level(LinphoneCore *lc, int level); void linphone_core_set_play_level(LinphoneCore *lc, int level); -/** - * Allow to control play level before entering sound card: level in db - * - * @ingroup media_parameters -**/ -void linphone_core_set_soft_play_level(LinphoneCore *lc, float level); -/** - * get play level before entering sound card: level in db - * - * @ingroup media_parameters -**/ -float linphone_core_get_soft_play_level(LinphoneCore *lc); + +void linphone_core_set_playback_gain_db(LinphoneCore *lc, float level); + +float linphone_core_get_playback_gain_db(LinphoneCore *lc); void linphone_core_set_rec_level(LinphoneCore *lc, int level); const char * linphone_core_get_ringer_device(LinphoneCore *lc); const char * linphone_core_get_playback_device(LinphoneCore *lc); diff --git a/mediastreamer2 b/mediastreamer2 index 61c0c75ba..b6b2f3006 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 61c0c75ba484ed0b09b6354bab240a1a6f922fce +Subproject commit b6b2f3006fd2d4331be838fdb34e363f0ea8eed5