File: dtmflib.h

package info (click to toggle)
rtpengine 13.5.1.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,676 kB
  • sloc: ansic: 86,775; perl: 59,422; python: 3,193; sh: 1,037; makefile: 687; asm: 211
file content (48 lines) | stat: -rw-r--r-- 1,939 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef _DTMFLIB_H_
#define _DTMFLIB_H_

#include <glib.h>
#include <inttypes.h>


struct telephone_event_payload {
	uint8_t event;
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
	unsigned volume:6;
	unsigned r:1;
	unsigned end:1;
#elif G_BYTE_ORDER == G_BIG_ENDIAN
	unsigned end:1;
	unsigned r:1;
	unsigned volume:6;
#else
#error "byte order unknown"
#endif
	uint16_t duration;
} __attribute__ ((packed));


void dtmf_samples_int16_t_mono(void *buf, unsigned long offset, unsigned long num, unsigned int event,
		unsigned int volume, unsigned int sample_rate);


void tone_samples_int16_t(int16_t *buf, unsigned long offset, unsigned long num, unsigned int freq,
		unsigned int volume, unsigned int sample_rate, unsigned int channels);
void tone_samples_int32_t(int32_t *buf, unsigned long offset, unsigned long num, unsigned int freq,
		unsigned int volume, unsigned int sample_rate, unsigned int channels);
void tone_samples_double(double *buf, unsigned long offset, unsigned long num, unsigned int freq,
		unsigned int volume, unsigned int sample_rate, unsigned int channels);
void tone_samples_float(float *buf, unsigned long offset, unsigned long num, unsigned int freq,
		unsigned int volume, unsigned int sample_rate, unsigned int channels);

void dtmf_samples_int16_t(int16_t *buf, unsigned long offset, unsigned long num, unsigned int event,
		unsigned int volume, unsigned int sample_rate, unsigned int channels);
void dtmf_samples_int32_t(int32_t *buf, unsigned long offset, unsigned long num, unsigned int event,
		unsigned int volume, unsigned int sample_rate, unsigned int channels);
void dtmf_samples_double(double *buf, unsigned long offset, unsigned long num, unsigned int event,
		unsigned int volume, unsigned int sample_rate, unsigned int channels);
void dtmf_samples_float(float *buf, unsigned long offset, unsigned long num, unsigned int event,
		unsigned int volume, unsigned int sample_rate, unsigned int channels);


#endif