fix missing logic in our poor man's vad

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5300 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale committed 2007-06-09 19:01:43 +00:00
1 parent eb80c72f71
commit 2056ac0e35
10 files changed
+4509 -5010

No files matched your search

+1 -1
View File
@@ -257,7 +257,7 @@ static const switch_codec_implementation_t raw_16k_30ms_implementation = {
static const switch_codec_implementation_t raw_16k_20ms_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 117,
/*.iananame */ "L16",
/*.iananame */ "L16_16k",
/*.fmtp */ NULL,
/*.samples_per_second = */ 16000,
/*.bits_per_second = */ 256000,
+1 -1
View File
@@ -283,7 +283,7 @@ static const switch_codec_implementation_t speex_32k_implementation = {
static const switch_codec_implementation_t speex_16k_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 99,
/*.ianacode */ 100,
/*.iananame */ "speex",
/*.fmtp */ NULL,
/*.samples_per_second */ 16000,
+2 -1
View File
@@ -1365,7 +1365,7 @@ static int rtp_common_write(switch_rtp_t *rtp_session, void *data, uint32_t data
}
send = 1;
} else {
if (score > rtp_session->vad_data.bg_level) {
if (score > rtp_session->vad_data.bg_level && !switch_test_flag(&rtp_session->vad_data, SWITCH_VAD_FLAG_TALKING)) {
uint32_t diff = score - rtp_session->vad_data.bg_level;
if (rtp_session->vad_data.hangover_hits) {
@@ -1373,6 +1373,7 @@ static int rtp_common_write(switch_rtp_t *rtp_session, void *data, uint32_t data
}
if (diff >= rtp_session->vad_data.diff_level || ++rtp_session->vad_data.hangunder_hits >= rtp_session->vad_data.hangunder) {
switch_set_flag(&rtp_session->vad_data, SWITCH_VAD_FLAG_TALKING);
send_msg->header.m = 1;
rtp_session->vad_data.hangover_hits = rtp_session->vad_data.hangunder_hits = rtp_session->vad_data.cng_count = 0;