38 #define BUFFER_SAMPLES 8096
41 #include "asterisk/slin.h"
48 unsigned char *src = f->
data.ptr;
49 int16_t *dst = pvt->outbuf.i16 + pvt->
samples;
55 *dst++ = AST_ALAW(*src++);
64 char *dst = pvt->outbuf.
c + pvt->
samples;
65 int16_t *src = f->
data.ptr;
71 *dst++ = AST_LIN2A(*src++);
80 .type = AST_MEDIA_TYPE_AUDIO,
85 .type = AST_MEDIA_TYPE_AUDIO,
90 .sample = alaw_sample,
91 .buffer_samples = BUFFER_SAMPLES,
92 .buf_size = BUFFER_SAMPLES * 2,
99 .type = AST_MEDIA_TYPE_AUDIO,
104 .type = AST_MEDIA_TYPE_AUDIO,
109 .sample = slin8_sample,
110 .buffer_samples = BUFFER_SAMPLES,
111 .buf_size = BUFFER_SAMPLES,
114 static int unload_module(
void)
124 static int load_module(
void)
139 AST_MODULE_INFO(
ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT,
"A-law Coder/Decoder",
140 .support_level = AST_MODULE_SUPPORT_CORE,
142 .unload = unload_module,
A-Law to Signed linear conversion.
int datalen
actual space used in outbuf
Asterisk main include file. File version handling, generic pbx functions.
Descriptor of a translator.
Support for translation of data formats. translate.c.
static int alawtolin_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
decode frame into lin and fill output buffer.
Configuration File Parser.
#define ast_register_translator(t)
See __ast_register_translator()
int ast_unregister_translator(struct ast_translator *t)
Unregister a translator Unregisters the given translator.
Default structure for translators, with the basic fields and buffers, all allocated as part of the sa...
union ast_frame::@224 data
Module has failed to load, may be in an inconsistent state.
Data structure associated with a single frame of data.
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
static int lintoalaw_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
convert and store input samples in output buffer