File: ex_gsm.h

package info (click to toggle)
asterisk 1%3A11.13.1~dfsg-2%2Bdeb8u5
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 48,196 kB
  • sloc: ansic: 550,573; sh: 12,057; cpp: 5,944; makefile: 3,079; perl: 3,076; yacc: 2,156; xml: 675; sql: 406; python: 381; tcl: 113; php: 62
file content (32 lines) | stat: -rw-r--r-- 738 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
/*! \file
 * \brief 8-bit raw data
 *
 * Copyright (C) 2008, Digium, Inc.
 *
 * Distributed under the terms of the GNU General Public License
 *
 */

static uint8_t ex_gsm[] = {
	0xda, 0xa6, 0xac, 0x2d, 0xa3, 0x50, 0x00, 0x49, 0x24, 0x92,
	0x49, 0x24, 0x50, 0x40, 0x49, 0x24, 0x92, 0x37, 0x24, 0x52,
	0x00, 0x49, 0x24, 0x92, 0x47, 0x24, 0x50, 0x80, 0x46, 0xe3,
	0x6d, 0xb8, 0xdc,
};

static struct ast_frame *gsm_sample(void)
{
	static struct ast_frame f = {
		.frametype = AST_FRAME_VOICE,
		.datalen = sizeof(ex_gsm),
		/* All frames are 20 ms long */
		.samples = GSM_SAMPLES,
		.mallocd = 0,
		.offset = 0,
		.src = __PRETTY_FUNCTION__,
		.data.ptr = ex_gsm,
	};

	ast_format_set(&f.subclass.format, AST_FORMAT_GSM, 0);
	return &f;
}