summaryrefslogtreecommitdiffstats
path: root/src/libdtmf/dtmf_encode.h
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2020-10-03 16:25:48 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2020-12-29 19:02:57 +0100
commit58f1c9a91226f4954a4799fab082f186923aa806 (patch)
treeab137478c73bcb079e3031cbc65ecc7ef37f452e /src/libdtmf/dtmf_encode.h
parentfde7cc2ce319bf294ded54da0822672fe33b1923 (diff)
Add libraries from Osmocom-Analog
Diffstat (limited to 'src/libdtmf/dtmf_encode.h')
-rw-r--r--src/libdtmf/dtmf_encode.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libdtmf/dtmf_encode.h b/src/libdtmf/dtmf_encode.h
new file mode 100644
index 0000000..15ac05e
--- /dev/null
+++ b/src/libdtmf/dtmf_encode.h
@@ -0,0 +1,14 @@
+
+typedef struct dtmf_enc {
+ int samplerate; /* samplerate */
+ char tone; /* current tone to be played */
+ int pos; /* sample counter for tone */
+ int max; /* max number of samples for tone duration */
+ double phaseshift65536[2]; /* how much the phase of sine wave changes per sample */
+ double phase65536[2]; /* current phase */
+} dtmf_enc_t;
+
+void dtmf_encode_init(dtmf_enc_t *dtmf, int samplerate, double dBm_level);
+void dtmf_encode_set_tone(dtmf_enc_t *dtmf, char tone);
+void dtmf_encode(dtmf_enc_t *dtmf, sample_t *samples, int length);
+