提交 a846877a authored 作者: Anthony Minessale's avatar Anthony Minessale

clean up tone_detect

git-svn-id: http://svn.openzap.org/svn/openzap/trunk@661 a93c3328-9c30-0410-af19-c9cd2b2d52af
上级 9b02e629
...@@ -141,10 +141,16 @@ void teletone_multi_tone_init(teletone_multi_tone_t *mt, teletone_tone_map_t *ma ...@@ -141,10 +141,16 @@ void teletone_multi_tone_init(teletone_multi_tone_t *mt, teletone_tone_map_t *ma
float theta = 0; float theta = 0;
int x = 0; int x = 0;
if (!mt->sample_rate) {
mt->sample_rate = 8000;
}
if(!mt->min_samples) { if(!mt->min_samples) {
mt->min_samples = 102; mt->min_samples = 102;
} }
mt->min_samples *= (mt->sample_rate / 8000);
if (!mt->positive_factor) { if (!mt->positive_factor) {
mt->positive_factor = 2; mt->positive_factor = 2;
} }
...@@ -157,10 +163,6 @@ void teletone_multi_tone_init(teletone_multi_tone_t *mt, teletone_tone_map_t *ma ...@@ -157,10 +163,6 @@ void teletone_multi_tone_init(teletone_multi_tone_t *mt, teletone_tone_map_t *ma
mt->hit_factor = 2; mt->hit_factor = 2;
} }
if (!mt->sample_rate) {
mt->sample_rate = 8000;
}
for(x = 0; x < TELETONE_MAX_TONES; x++) { for(x = 0; x < TELETONE_MAX_TONES; x++) {
if ((int) map->freqs[x] == 0) { if ((int) map->freqs[x] == 0) {
break; break;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论