2016-03-13 12:37:27 +00:00
|
|
|
|
2017-11-15 17:45:56 +00:00
|
|
|
typedef struct dtmf_enc {
|
2016-03-13 12:37:27 +00:00
|
|
|
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 */
|
2017-01-29 06:25:12 +00:00
|
|
|
double phaseshift65536[2]; /* how much the phase of sine wave changes per sample */
|
|
|
|
double phase65536[2]; /* current phase */
|
2017-11-15 17:45:56 +00:00
|
|
|
} dtmf_enc_t;
|
2016-03-13 12:37:27 +00:00
|
|
|
|
2017-11-15 17:45:56 +00:00
|
|
|
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);
|
2016-03-13 12:37:27 +00:00
|
|
|
|