diff options
Diffstat (limited to 'src/libdtmf/dtmf_encode.h')
-rw-r--r-- | src/libdtmf/dtmf_encode.h | 14 |
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); + |