summaryrefslogtreecommitdiffstats
path: root/src/libdtmf/dtmf_encode.h
blob: 15ac05ede3a940f32421a318d8157f9ac0796d15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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);