Asterisk - The Open Source Telephony Project
18.5.0
|
Work with WAV in the proprietary Microsoft format. Microsoft WAV format (8000hz Signed Linear) More...
#include "asterisk.h"
#include "asterisk/mod_format.h"
#include "asterisk/module.h"
#include "asterisk/endian.h"
#include "asterisk/format_cache.h"
#include "asterisk/format.h"
#include "asterisk/codec.h"
Go to the source code of this file.
Data Structures | |
struct | wav_desc |
Macros | |
#define | BLOCKSIZE 160 |
#define | WAV_BUF_SIZE 320 |
#define | WAV_HEADER_SIZE 44 |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static int | check_header (FILE *f, int hz) |
static int | check_header_fmt (FILE *f, int hsize, int hz) |
static int | load_module (void) |
static int | unload_module (void) |
static int | update_header (FILE *f) |
static void | wav_close (struct ast_filestream *s) |
static int | wav_open (struct ast_filestream *s) |
static struct ast_frame * | wav_read (struct ast_filestream *s, int *whennext) |
static int | wav_rewrite (struct ast_filestream *s, const char *comment) |
static int | wav_seek (struct ast_filestream *fs, off_t sample_offset, int whence) |
static off_t | wav_tell (struct ast_filestream *fs) |
static int | wav_trunc (struct ast_filestream *fs) |
static int | wav_write (struct ast_filestream *fs, struct ast_frame *f) |
static int | write_header (FILE *f, int writehz) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Microsoft WAV/WAV16 format (8kHz/16kHz Signed Linear)" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "30ef0c93b36035ec78c9cfd712d36d9b" , .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_APP_DEPEND } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static struct ast_format_def | wav16_f |
static struct ast_format_def | wav_f |
Work with WAV in the proprietary Microsoft format. Microsoft WAV format (8000hz Signed Linear)
Definition in file format_wav.c.
#define BLOCKSIZE 160 |
Definition at line 56 of file format_wav.c.
#define WAV_BUF_SIZE 320 |
Definition at line 44 of file format_wav.c.
Referenced by wav_read().
#define WAV_HEADER_SIZE 44 |
Definition at line 46 of file format_wav.c.
Referenced by wav_seek().
|
static |
Definition at line 572 of file format_wav.c.
|
static |
Definition at line 572 of file format_wav.c.
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 572 of file format_wav.c.
|
static |
Definition at line 140 of file format_wav.c.
References ast_log, buf, check_header_fmt(), LOG_DEBUG, LOG_WARNING, and type.
Referenced by wav_open().
|
static |
Definition at line 81 of file format_wav.c.
References ast_log, chans, format, and LOG_WARNING.
Referenced by check_header().
|
static |
Definition at line 555 of file format_wav.c.
References ast_format_def_register, ast_format_slin, ast_format_slin16, AST_MODFLAG_LOAD_ORDER, AST_MODPRI_APP_DEPEND, AST_MODULE_INFO(), AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, AST_MODULE_SUPPORT_CORE, ASTERISK_GPL_KEY, ast_format_def::format, and unload_module().
|
static |
Definition at line 549 of file format_wav.c.
References ast_format_def_unregister(), and ast_format_def::name.
Referenced by load_module().
|
static |
Definition at line 207 of file format_wav.c.
References ast_log, wav_desc::bytes, end, and LOG_WARNING.
Referenced by wav_close(), and wav_trunc().
|
static |
Definition at line 349 of file format_wav.c.
References ast_filestream::_private, ast_log, wav_desc::bytes, errno, ast_filestream::f, ast_filestream::filename, if(), LOG_WARNING, ast_filestream::mode, and update_header().
|
static |
Definition at line 319 of file format_wav.c.
References ast_filestream::_private, ast_format_get_sample_rate(), check_header(), ast_filestream::f, ast_filestream::fmt, ast_format_def::format, wav_desc::hz, wav_desc::maxlen, and tmp().
|
static |
Definition at line 370 of file format_wav.c.
References ast_filestream::_private, ast_format_get_name(), AST_FRAME_SET_BUFFER, AST_FRIENDLY_OFFSET, ast_log, ast_filestream::buf, wav_desc::bytes, ast_frame::data, ast_frame::datalen, errno, ast_filestream::f, ast_frame_subclass::format, ast_filestream::fr, wav_desc::hz, LOG_WARNING, wav_desc::maxlen, NULL, ast_frame::ptr, ast_frame::samples, ast_frame::subclass, tmp(), and WAV_BUF_SIZE.
|
static |
Definition at line 336 of file format_wav.c.
References ast_filestream::_private, ast_format_get_sample_rate(), ast_filestream::f, ast_filestream::fmt, ast_format_def::format, wav_desc::hz, tmp(), and write_header().
|
static |
Definition at line 453 of file format_wav.c.
References ast_log, AST_LOG_WARNING, errno, ast_filestream::f, max, min, SEEK_FORCECUR, and WAV_HEADER_SIZE.
|
static |
|
static |
Definition at line 489 of file format_wav.c.
References ast_log, AST_LOG_WARNING, errno, ast_filestream::f, and update_header().
|
static |
Definition at line 416 of file format_wav.c.
References ast_filestream::_private, ast_log, wav_desc::bytes, ast_frame::data, ast_frame::datalen, errno, ast_filestream::f, if(), LOG_WARNING, ast_frame::ptr, and tmp().
|
static |
Definition at line 248 of file format_wav.c.
References ast_log, wav_desc::hz, and LOG_WARNING.
Referenced by wav_rewrite().
|
static |
Definition at line 572 of file format_wav.c.
|
static |
Definition at line 572 of file format_wav.c.
|
static |
Definition at line 517 of file format_wav.c.
|
static |
Definition at line 533 of file format_wav.c.