aboutsummaryrefslogtreecommitdiffstats
path: root/src/libdtmf/dtmf_decode.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libdtmf/dtmf_decode.h')
-rw-r--r--src/libdtmf/dtmf_decode.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libdtmf/dtmf_decode.h b/src/libdtmf/dtmf_decode.h
index 7c5780f..ea2ff8e 100644
--- a/src/libdtmf/dtmf_decode.h
+++ b/src/libdtmf/dtmf_decode.h
@@ -1,6 +1,8 @@
#include "../libfm/fm.h"
-typedef struct ftmf_meas {
+#define DTMF_FREQ_MARGIN_PERCENT_DEFAULT 3 /* 1.8 .. 3.5 % */
+
+typedef struct dtmf_meas {
double frequency_low;
double frequency_high;
double amplitude_low;
@@ -28,8 +30,9 @@ typedef struct dtmf_dec {
dtmf_meas_t meas; /* measurements */
} dtmf_dec_t;
-int dtmf_decode_init(dtmf_dec_t *dtmf, void *priv, void (*recv_digit)(void *priv, char digit, dtmf_meas_t *meas), int samplerate, double max_amplitude, double min_amplitude);
+int dtmf_decode_init(dtmf_dec_t *dtmf, void *priv, void (*recv_digit)(void *priv, char digit, dtmf_meas_t *meas), int samplerate, double max_amplitude, double min_amplitude, double freq_margin);
void dtmf_decode_exit(dtmf_dec_t *dtmf);
+void dtmf_decode_reset(dtmf_dec_t *dtmf);
void dtmf_decode(dtmf_dec_t *dtmf, sample_t *samples, int length);
void dtmf_decode_filter(dtmf_dec_t *dtmf, sample_t *samples, int length, sample_t *frequency_low, sample_t *frequency_high, sample_t *amplitude_low, sample_t *amplitude_high);