Asterisk - The Open Source Telephony Project
18.5.0
|
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 | |
AST_MODULE_INFO_STANDARD_EXTENDED (ASTERISK_GPL_KEY, "Audio Effects Dialplan Functions") | |
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_custom_function | pitch_shift_function |
static const struct ast_datastore_info | pitchshift_datastore |
Pitch Shift Audio Effect.
Definition in file func_pitchshift.c.
#define HIGH 1.25 |
Definition at line 120 of file func_pitchshift.c.
Referenced by pitchshift_helper().
#define HIGHER 1.5 |
Definition at line 119 of file func_pitchshift.c.
Referenced by pitchshift_helper().
#define HIGHEST 2 |
Definition at line 118 of file func_pitchshift.c.
Referenced by pitchshift_helper().
#define LOW .85 |
Definition at line 121 of file func_pitchshift.c.
Referenced by pitchshift_helper().
#define LOWER .7 |
Definition at line 122 of file func_pitchshift.c.
Referenced by pitchshift_helper().
#define LOWEST .5 |
Definition at line 123 of file func_pitchshift.c.
Referenced by pitchshift_helper().
#define M_PI 3.14159265358979323846 |
Definition at line 114 of file func_pitchshift.c.
Referenced by smb_fft(), and smb_pitch_shift().
#define MAX_FRAME_LENGTH 256 |
Definition at line 116 of file func_pitchshift.c.
Referenced by pitch_shift().
AST_MODULE_INFO_STANDARD_EXTENDED | ( | ASTERISK_GPL_KEY | , |
"Audio Effects Dialplan Functions" | |||
) |
Referenced by load_module().
|
static |
Definition at line 151 of file func_pitchshift.c.
References ast_audiohook_destroy(), ast_free, and pitchshift_data::audiohook.
|
static |
Definition at line 504 of file func_pitchshift.c.
References ast_custom_function_register, AST_MODULE_INFO_STANDARD_EXTENDED(), AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, and ASTERISK_GPL_KEY.
Definition at line 478 of file func_pitchshift.c.
References ast_format_get_sample_rate(), ast_frame::data, ast_frame_subclass::format, 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 164 of file func_pitchshift.c.
References AST_AUDIOHOOK_DIRECTION_WRITE, AST_AUDIOHOOK_STATUS_DONE, ast_channel_datastore_find(), ast_datastore::data, NULL, pitch_shift(), pitchshift_data::rx, fft_data::shift_amount, ast_audiohook::status, and pitchshift_data::tx.
Referenced by pitchshift_helper().
|
static |
Definition at line 192 of file func_pitchshift.c.
References ast_audiohook_attach(), ast_audiohook_init(), AST_AUDIOHOOK_MANIPULATE_ALL_RATES, 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, NULL, pitchshift_cb(), pitchshift_data::rx, fft_data::shift_amount, and pitchshift_data::tx.
|
static |
|
static |
Definition at line 319 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, fft_data::sys_magn, tmp(), and window.
Referenced by pitch_shift().
|
static |
Definition at line 499 of file func_pitchshift.c.
References ast_custom_function_unregister().
|
static |
Definition at line 494 of file func_pitchshift.c.
|
static |
Definition at line 159 of file func_pitchshift.c.