| Asterisk - The Open Source Telephony Project GIT-master-27fb039
    | 
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 138 of file func_pitchshift.c.
| #define HIGHER 1.5 | 
Definition at line 137 of file func_pitchshift.c.
| #define HIGHEST 2 | 
Definition at line 136 of file func_pitchshift.c.
| #define LOW .85 | 
Definition at line 139 of file func_pitchshift.c.
| #define LOWER .7 | 
Definition at line 140 of file func_pitchshift.c.
| #define LOWEST .5 | 
Definition at line 141 of file func_pitchshift.c.
| #define M_PI 3.14159265358979323846 | 
Definition at line 132 of file func_pitchshift.c.
| #define MAX_FRAME_LENGTH 256 | 
Definition at line 134 of file func_pitchshift.c.
| AST_MODULE_INFO_STANDARD_EXTENDED | ( | ASTERISK_GPL_KEY | , | 
| "Audio Effects Dialplan Functions" | |||
| ) | 
| 
 | static | 
Definition at line 169 of file func_pitchshift.c.
References ast_audiohook_destroy(), ast_free, and pitchshift_data::audiohook.
| 
 | static | 
Definition at line 522 of file func_pitchshift.c.
References ast_custom_function_register, AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, and pitch_shift_function.
Definition at line 496 of file func_pitchshift.c.
References ast_format_get_sample_rate(), ast_frame::data, ast_frame_subclass::format, MAX_FRAME_LENGTH, ast_frame::ptr, ast_frame::samples, smb_pitch_shift(), and ast_frame::subclass.
Referenced by pitchshift_cb().
| 
 | static | 
Definition at line 182 of file func_pitchshift.c.
References AST_AUDIOHOOK_DIRECTION_WRITE, AST_AUDIOHOOK_STATUS_DONE, ast_channel_datastore_find(), pitchshift_data::audiohook, ast_datastore::data, NULL, pitch_shift(), pitchshift_datastore, pitchshift_data::rx, fft_data::shift_amount, ast_audiohook::status, and pitchshift_data::tx.
Referenced by pitchshift_helper().
| 
 | static | 
Definition at line 210 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_datastore, pitchshift_data::rx, fft_data::shift_amount, pitchshift_data::tx, and value.
| 
 | static | 
Definition at line 291 of file func_pitchshift.c.
Referenced by smb_pitch_shift().
| 
 | static | 
Definition at line 337 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, and window.
Referenced by pitch_shift().
| 
 | static | 
Definition at line 517 of file func_pitchshift.c.
References ast_custom_function_unregister(), and pitch_shift_function.
| 
 | static | 
Definition at line 512 of file func_pitchshift.c.
Referenced by load_module(), and unload_module().
| 
 | static | 
Definition at line 177 of file func_pitchshift.c.
Referenced by pitchshift_cb(), and pitchshift_helper().