aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/dtmf.h
blob: d6a5322bfe5df9e813eddbf89f65120f07ece5d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
typedef struct dtmf {
	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_t;

void dtmf_init(dtmf_t *dtmf, int samplerate);
void dtmf_set_tone(dtmf_t *dtmf, char tone);
void dtmf_tone(dtmf_t *dtmf, sample_t *samples, int length);