Pitch Shift Audio Effect. More...
#include "asterisk.h"
#include "asterisk/module.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/utils.h"
#include "asterisk/audiohook.h"
#include <math.h>
Go to the source code of this file.
Data Structures | |
struct | fft_data |
struct | pitchshift_data |
Macros | |
#define | HIGH 1.25 |
#define | HIGHER 1.5 |
#define | HIGHEST 2 |
#define | LOW .85 |
#define | LOWER .7 |
#define | LOWEST .5 |
#define | M_PI 3.14159265358979323846 |
#define | MAX_FRAME_LENGTH 256 |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static void | destroy_callback (void *data) |
static int | load_module (void) |
static int | pitch_shift (struct ast_frame *f, float amount, struct fft_data *fft_data) |
static int | pitchshift_cb (struct ast_audiohook *audiohook, struct ast_channel *chan, struct ast_frame *f, enum ast_audiohook_direction direction) |
static int | pitchshift_helper (struct ast_channel *chan, const char *cmd, char *data, const char *value) |
static void | smb_fft (float *fft_buffer, long fft_frame_size, long sign) |
static void | smb_pitch_shift (float pitchShift, long num_samps_to_process, long fft_frame_size, long osamp, float sample_rate, int16_t *indata, int16_t *outdata, struct fft_data *fft_data) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Audio Effects Dialplan Functions" , .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 = "ac1f6a56484a8820659555499174e588" , .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, } |
static struct ast_module_info * | ast_module_info = &__mod_info |
static struct ast_custom_function | pitch_shift_function |
static struct ast_datastore_info | pitchshift_datastore |
Pitch Shift Audio Effect.
Definition in file func_pitchshift.c.
#define HIGH 1.25 |
Definition at line 122 of file func_pitchshift.c.
Referenced by pitchshift_helper().
#define HIGHER 1.5 |
Definition at line 121 of file func_pitchshift.c.
Referenced by pitchshift_helper().
#define HIGHEST 2 |
Definition at line 120 of file func_pitchshift.c.
Referenced by pitchshift_helper().
#define LOW .85 |
Definition at line 123 of file func_pitchshift.c.
Referenced by pitchshift_helper().
#define LOWER .7 |
Definition at line 124 of file func_pitchshift.c.
Referenced by pitchshift_helper().
#define LOWEST .5 |
Definition at line 125 of file func_pitchshift.c.
Referenced by pitchshift_helper().
#define M_PI 3.14159265358979323846 |
Definition at line 116 of file func_pitchshift.c.
Referenced by ast_playtones_start(), callerid_init(), goertzel_init(), make_tone_burst(), smb_fft(), smb_pitch_shift(), tdd_init(), and tonepair_alloc().
#define MAX_FRAME_LENGTH 256 |
Definition at line 118 of file func_pitchshift.c.
Referenced by pitch_shift().
|
static |
Definition at line 515 of file func_pitchshift.c.
|
static |
Definition at line 515 of file func_pitchshift.c.
|
static |
Definition at line 153 of file func_pitchshift.c.
References ast_audiohook_destroy(), ast_free, and pitchshift_data::audiohook.
|
static |
Definition at line 509 of file func_pitchshift.c.
References ast_custom_function_register, AST_MODULE_LOAD_DECLINE, and AST_MODULE_LOAD_SUCCESS.
Definition at line 483 of file func_pitchshift.c.
References ast_format_rate(), ast_frame_subclass::codec, ast_frame::data, if(), MAX_FRAME_LENGTH, ast_frame::ptr, ast_frame::samples, smb_pitch_shift(), and ast_frame::subclass.
Referenced by pitchshift_cb().
|
static |
Definition at line 166 of file func_pitchshift.c.
References AST_AUDIOHOOK_DIRECTION_WRITE, AST_AUDIOHOOK_STATUS_DONE, ast_channel_datastore_find(), AST_FORMAT_SLINEAR, AST_FORMAT_SLINEAR16, AST_FRAME_VOICE, ast_frame_subclass::codec, ast_datastore::data, ast_frame::frametype, pitch_shift(), pitchshift_data::rx, fft_data::shift_amount, ast_audiohook::status, ast_frame::subclass, and pitchshift_data::tx.
Referenced by pitchshift_helper().
|
static |
Definition at line 197 of file func_pitchshift.c.
References ast_audiohook_attach(), ast_audiohook_init(), AST_AUDIOHOOK_TYPE_MANIPULATE, ast_calloc, ast_channel_datastore_add(), ast_channel_datastore_find(), ast_channel_lock, ast_channel_unlock, ast_datastore_alloc(), ast_datastore_free(), ast_log(), pitchshift_data::audiohook, ast_datastore::data, HIGH, HIGHER, HIGHEST, LOG_ERROR, LOG_WARNING, LOW, LOWER, LOWEST, ast_audiohook::manipulate_callback, pitchshift_cb(), pitchshift_data::rx, fft_data::shift_amount, and pitchshift_data::tx.
|
static |
|
static |
Definition at line 324 of file func_pitchshift.c.
References fft_data::ana_freq, fft_data::ana_magn, cos, fft_data::fft_worksp, fft_data::gRover, fft_data::in_fifo, fft_data::last_phase, M_PI, fft_data::out_fifo, fft_data::output_accum, smb_fft(), step_size(), fft_data::sum_phase, fft_data::syn_freq, and fft_data::sys_magn.
Referenced by pitch_shift().
|
static |
Definition at line 504 of file func_pitchshift.c.
References ast_custom_function_unregister().
|
static |
Definition at line 515 of file func_pitchshift.c.
|
static |
Definition at line 515 of file func_pitchshift.c.
|
static |
Definition at line 499 of file func_pitchshift.c.
|
static |
Definition at line 161 of file func_pitchshift.c.