Restructure: Move dtmf from common code to 'libdtmf'

This commit is contained in:
Andreas Eversberg
2017-11-15 18:45:56 +01:00
parent 17b34fbae6
commit fd3a4d7ac2
11 changed files with 31 additions and 23 deletions

14
src/libdtmf/dtmf_encode.h Normal file
View File

@@ -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);