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;
56 *dst++ = AST_MULAW(*src++);
65 char *dst = pvt->outbuf.
c + pvt->
samples;
66 int16_t *src = f->
data.ptr;
72 *dst++ = AST_LIN2MU(*src++);
85 .type = AST_MEDIA_TYPE_AUDIO,
90 .type = AST_MEDIA_TYPE_AUDIO,
95 .sample = ulaw_sample,
96 .buffer_samples = BUFFER_SAMPLES,
97 .buf_size = BUFFER_SAMPLES * 2,
108 .type = AST_MEDIA_TYPE_AUDIO,
113 .type = AST_MEDIA_TYPE_AUDIO,
118 .sample = slin8_sample,
119 .buf_size = BUFFER_SAMPLES,
120 .buffer_samples = BUFFER_SAMPLES,
123 static int unload_module(
void)
133 static int load_module(
void)
148 AST_MODULE_INFO(
ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT,
"mu-Law Coder/Decoder",
149 .support_level = AST_MODULE_SUPPORT_CORE,
151 .unload = unload_module,
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 ulawtolin_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
convert and store samples in outbuf
static struct ast_translator ulawtolin
The complete translator for ulawToLin.
Configuration File Parser.
u-Law to Signed linear conversion
#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.
static int lintoulaw_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
convert and store samples in outbuf
Data structure associated with a single frame of data.
static struct ast_translator lintoulaw
The complete translator for LinToulaw.
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.