Asterisk - The Open Source Telephony Project
18.5.0
|
Convenient Signal Processing routines. More...
Go to the source code of this file.
Data Structures | |
struct | ast_dsp_busy_pattern |
Enumerations | |
enum | threshold { THRESHOLD_SILENCE = 0, THRESHOLD_MAX = 1 } |
Functions | |
int | ast_dsp_busydetect (struct ast_dsp *dsp) |
Return non-zero if historically this should be a busy, request that ast_dsp_silence has already been called. More... | |
int | ast_dsp_call_progress (struct ast_dsp *dsp, struct ast_frame *inf) |
Scans for progress indication in audio. More... | |
int | ast_dsp_digitdetect (struct ast_dsp *dsp, struct ast_frame *f) |
Return non-zero if DTMF hit was found. More... | |
void | ast_dsp_digitreset (struct ast_dsp *dsp) |
Reset DTMF detector. More... | |
void | ast_dsp_free (struct ast_dsp *dsp) |
int | ast_dsp_get_features (struct ast_dsp *dsp) |
Get features. More... | |
unsigned int | ast_dsp_get_sample_rate (const struct ast_dsp *dsp) |
Retrieve the sample rate this DSP structure was created with. More... | |
int | ast_dsp_get_tcount (struct ast_dsp *dsp) |
Get tcount (Threshold counter) More... | |
int | ast_dsp_get_threshold_from_settings (enum threshold which) |
Get silence threshold from dsp.conf. More... | |
int | ast_dsp_get_tstate (struct ast_dsp *dsp) |
Get tstate (Tone State) More... | |
int | ast_dsp_getdigits (struct ast_dsp *dsp, char *buf, int max) |
Get pending DTMF/MF digits. More... | |
struct ast_dsp * | ast_dsp_new (void) |
Allocates a new dsp, assumes 8khz for internal sample rate. More... | |
struct ast_dsp * | ast_dsp_new_with_rate (unsigned int sample_rate) |
Allocates a new dsp with a specific internal sample rate used during processing. More... | |
int | ast_dsp_noise (struct ast_dsp *dsp, struct ast_frame *f, int *totalnoise) |
Process the audio frame for noise. More... | |
struct ast_frame * | ast_dsp_process (struct ast_channel *chan, struct ast_dsp *dsp, struct ast_frame *inf) |
Return AST_FRAME_NULL frames when there is silence, AST_FRAME_BUSY on busies, and call progress, all dependent upon which features are enabled. More... | |
void | ast_dsp_reset (struct ast_dsp *dsp) |
Reset total silence count. More... | |
void | ast_dsp_set_busy_count (struct ast_dsp *dsp, int cadences) |
Set number of required cadences for busy. More... | |
void | ast_dsp_set_busy_pattern (struct ast_dsp *dsp, const struct ast_dsp_busy_pattern *cadence) |
Set expected lengths of the busy tone. More... | |
int | ast_dsp_set_call_progress_zone (struct ast_dsp *dsp, char *zone) |
Set zone for doing progress detection. More... | |
int | ast_dsp_set_digitmode (struct ast_dsp *dsp, int digitmode) |
Set digit mode. More... | |
int | ast_dsp_set_faxmode (struct ast_dsp *dsp, int faxmode) |
Set fax mode. More... | |
void | ast_dsp_set_features (struct ast_dsp *dsp, int features) |
Select feature set. More... | |
int | ast_dsp_set_freqmode (struct ast_dsp *dsp, int freq1, int dur, int db, int squelch) |
Set arbitrary frequency detection mode. More... | |
void | ast_dsp_set_threshold (struct ast_dsp *dsp, int threshold) |
Set the minimum average magnitude threshold to determine talking by the DSP. More... | |
int | ast_dsp_silence (struct ast_dsp *dsp, struct ast_frame *f, int *totalsilence) |
Process the audio frame for silence. More... | |
int | ast_dsp_silence_with_energy (struct ast_dsp *dsp, struct ast_frame *f, int *totalsilence, int *frames_energy) |
Process the audio frame for silence. More... | |
int | ast_dsp_was_muted (struct ast_dsp *dsp) |
Returns true if DSP code was muting any fragment of the last processed frame. Muting (squelching) happens when DSP code removes DTMF/MF/generic tones from the audio. More... | |
Convenient Signal Processing routines.
Definition in file dsp.h.
#define DSP_DIGITMODE_DTMF 0 |
Detect DTMF digits
Definition at line 31 of file dsp.h.
Referenced by __ast_dsp_new(), analog_ss_thread(), ast_dsp_set_digitmode(), dahdi_hangup(), dahdi_new(), dahdi_setoption(), enable_dsp_detect(), mbl_load_device(), mkintf(), my_dsp_set_digitmode(), and ooh323_new().
#define DSP_DIGITMODE_MF 1 |
Detect MF digits
Definition at line 32 of file dsp.h.
Referenced by __ast_dsp_new(), analog_ss_thread(), ast_dsp_digitreset(), ast_dsp_process(), ast_dsp_set_digitmode(), my_dsp_set_digitmode(), and read_mf_digits().
#define DSP_DIGITMODE_MUTECONF (1 << 9) |
Mute conference
Definition at line 35 of file dsp.h.
Referenced by ast_dsp_set_digitmode(), dahdi_setoption(), read_mf_exec(), and read_sf_exec().
#define DSP_DIGITMODE_MUTEMAX (1 << 10) |
Delay audio by a frame to try to extra quelch
Definition at line 36 of file dsp.h.
Referenced by ast_dsp_set_digitmode(), dahdi_setoption(), read_mf_exec(), and read_sf_exec().
#define DSP_DIGITMODE_NOQUELCH (1 << 8) |
Do not quelch DTMF from in-band
Definition at line 34 of file dsp.h.
Referenced by ast_dsp_process(), mgcp_new(), read_mf_exec(), and read_sf_exec().
#define DSP_DIGITMODE_RELAXDTMF (1 << 11) |
"Radio" mode (relaxed DTMF)
Definition at line 37 of file dsp.h.
Referenced by ast_dsp_process(), dahdi_setoption(), enable_dsp_detect(), mbl_load_device(), ooh323_new(), process_dahdi(), read_mf_exec(), and read_sf_exec().
#define DSP_FAXMODE_DETECT_ALL (DSP_FAXMODE_DETECT_CNG | DSP_FAXMODE_DETECT_CED) |
#define DSP_FAXMODE_DETECT_CED (1 << 1) |
Definition at line 48 of file dsp.h.
Referenced by ast_dsp_process(), and ooh323_new().
#define DSP_FAXMODE_DETECT_CNG (1 << 0) |
Definition at line 47 of file dsp.h.
Referenced by __ast_dsp_new(), ast_dsp_process(), fax_detect_new(), and ooh323_new().
#define DSP_FAXMODE_DETECT_SQUELCH (1 << 2) |
Definition at line 49 of file dsp.h.
Referenced by ast_fax_detect_init(), and fax_detect_new().
#define DSP_FEATURE_BUSY_DETECT (1 << 1) |
Definition at line 27 of file dsp.h.
Referenced by ast_dsp_process(), and dahdi_new().
#define DSP_FEATURE_CALL_PROGRESS (DSP_PROGRESS_TALK | DSP_PROGRESS_RINGING | DSP_PROGRESS_BUSY | DSP_PROGRESS_CONGESTION) |
Definition at line 43 of file dsp.h.
Referenced by __ast_dsp_call_progress(), ast_dsp_process(), and dahdi_new().
#define DSP_FEATURE_DIGIT_DETECT (1 << 3) |
Definition at line 28 of file dsp.h.
Referenced by ast_dsp_process(), ast_dsp_set_features(), ast_sip_session_alloc(), dahdi_dtmf_detect_disable(), dahdi_dtmf_detect_enable(), dahdi_new(), enable_dsp_detect(), mbl_load_device(), mgcp_new(), misdn_set_opt_exec(), ooh323_new(), pjsip_acf_dtmf_mode_write(), read_config(), read_mf_digits(), set_caps(), and sip_rtp_read().
#define DSP_FEATURE_FAX_DETECT (1 << 4) |
Definition at line 29 of file dsp.h.
Referenced by ast_dsp_process(), ast_sip_session_alloc(), chan_pjsip_cng_tone_detected(), chan_pjsip_read_stream(), dahdi_handle_dtmf(), dahdi_new(), dahdi_queryoption(), dahdi_read(), dahdi_setoption(), enable_dsp_detect(), fax_detect_new(), misdn_set_opt_exec(), my_handle_dtmf(), ooh323_new(), and read_config().
#define DSP_FEATURE_FREQ_DETECT (1 << 21) |
Enable arbitrary tone detection
Definition at line 45 of file dsp.h.
Referenced by ast_dsp_process(), detect_write(), read_sf_digits(), and wait_exec().
#define DSP_FEATURE_SILENCE_SUPPRESS (1 << 0) |
Definition at line 26 of file dsp.h.
Referenced by __ast_dsp_new(), and ast_dsp_process().
#define DSP_FEATURE_WAITDIALTONE (1 << 20) |
Enable dial tone detection
Definition at line 44 of file dsp.h.
Referenced by ast_dsp_process(), dahdi_new(), and dahdi_read().
#define DSP_PROGRESS_BUSY (1 << 18) |
Enable busy tone detection
Definition at line 41 of file dsp.h.
Referenced by __ast_dsp_call_progress().
#define DSP_PROGRESS_CONGESTION (1 << 19) |
Enable congestion tone detection
Definition at line 42 of file dsp.h.
Referenced by __ast_dsp_call_progress().
#define DSP_PROGRESS_RINGING (1 << 17) |
Enable calling tone detection
Definition at line 40 of file dsp.h.
Referenced by __ast_dsp_call_progress().
#define DSP_PROGRESS_TALK (1 << 16) |
Enable talk detection
Definition at line 39 of file dsp.h.
Referenced by __ast_dsp_call_progress(), and dahdi_new().
#define DSP_TONE_STATE_BUSY 4 |
Definition at line 56 of file dsp.h.
Referenced by __ast_dsp_call_progress().
#define DSP_TONE_STATE_DIALTONE 2 |
Definition at line 54 of file dsp.h.
Referenced by __ast_dsp_call_progress(), and dahdi_read().
#define DSP_TONE_STATE_HUNGUP 8 |
Definition at line 60 of file dsp.h.
Referenced by __ast_dsp_call_progress().
#define DSP_TONE_STATE_RINGING 1 |
Definition at line 53 of file dsp.h.
Referenced by __ast_dsp_call_progress(), and dahdi_read().
#define DSP_TONE_STATE_SILENCE 0 |
Definition at line 52 of file dsp.h.
Referenced by __ast_dsp_call_progress().
#define DSP_TONE_STATE_SPECIAL1 5 |
Definition at line 57 of file dsp.h.
Referenced by __ast_dsp_call_progress().
#define DSP_TONE_STATE_SPECIAL2 6 |
Definition at line 58 of file dsp.h.
Referenced by __ast_dsp_call_progress().
#define DSP_TONE_STATE_SPECIAL3 7 |
Definition at line 59 of file dsp.h.
Referenced by __ast_dsp_call_progress().
#define DSP_TONE_STATE_TALKING 3 |
Definition at line 55 of file dsp.h.
Referenced by __ast_dsp_call_progress().
enum threshold |
int ast_dsp_busydetect | ( | struct ast_dsp * | dsp | ) |
Return non-zero if historically this should be a busy, request that ast_dsp_silence has already been called.
Definition at line 1295 of file dsp.c.
References abs, ast_debug, ast_dsp::busy_cadence, BUSY_MAX, BUSY_MIN, BUSY_PAT_PERCENT, BUSY_PERCENT, ast_dsp::busycount, ast_dsp::busymaybe, DSP_HISTORY, ast_dsp::historicnoise, ast_dsp::historicsilence, ast_dsp_busy_pattern::length, MAX, and ast_dsp_busy_pattern::pattern.
Referenced by ast_dsp_process().
Scans for progress indication in audio.
Definition at line 1216 of file dsp.c.
References __ast_dsp_call_progress(), ast_format_cache_is_slinear(), AST_FRAME_VOICE, ast_log, ast_frame::data, ast_frame::datalen, ast_frame_subclass::format, ast_frame::frametype, LOG_WARNING, ast_frame::ptr, and ast_frame::subclass.
Return non-zero if DTMF hit was found.
void ast_dsp_digitreset | ( | struct ast_dsp * | dsp | ) |
Reset DTMF detector.
Definition at line 1797 of file dsp.c.
References dtmf_detect_state_t::col_out, digit_detect_state_t::current_digits, dtmf_detect_state_t::current_hit, mf_detect_state_t::current_hit, dtmf_detect_state_t::current_sample, mf_detect_state_t::current_sample, ast_dsp::digit_state, ast_dsp::digitmode, digit_detect_state_t::digits, DSP_DIGITMODE_MF, digit_detect_state_t::dtmf, ast_dsp::dtmf_began, dtmf_detect_state_t::energy, goertzel_reset(), dtmf_detect_state_t::hits, mf_detect_state_t::hits, dtmf_detect_state_t::lasthit, digit_detect_state_t::mf, dtmf_detect_state_t::misses, dtmf_detect_state_t::row_out, digit_detect_state_t::td, and mf_detect_state_t::tone_out.
Referenced by analog_ss_thread(), mbl_new(), my_dsp_reset_and_flush_digits(), test_dtmf_amplitude_sweep(), and test_dtmf_twist_sweep().
void ast_dsp_free | ( | struct ast_dsp * | dsp | ) |
Definition at line 1770 of file dsp.c.
References ast_free.
Referenced by __ast_play_and_record(), analog_ss_thread(), AST_TEST_DEFINE(), background_detect_exec(), chan_list_destructor(), chan_pjsip_cng_tone_detected(), chan_pjsip_read_stream(), conf_run(), dahdi_hangup(), datastore_destroy_cb(), destroy_callback(), destroy_endpoint(), destroy_faxdetect(), destroy_session(), disable_dsp_detect(), do_waiting(), handle_recordfile(), isAnsweringMachine(), mbl_load_device(), mgcp_hangup(), my_all_subchannels_hungup(), my_dsp_set_digitmode(), ooh323_destroy(), pjsip_acf_dtmf_mode_write(), read_mf_digits(), read_sf_digits(), record_exec(), session_destructor(), set_caps(), set_softmix_bridge_data(), sip_rtp_read(), softmix_bridge_leave(), unload_module(), and wait_exec().
int ast_dsp_get_features | ( | struct ast_dsp * | dsp | ) |
Get features.
Definition at line 1764 of file dsp.c.
References ast_dsp::features.
Referenced by chan_pjsip_cng_tone_detected(), chan_pjsip_read_stream(), pjsip_acf_dtmf_mode_write(), and set_caps().
unsigned int ast_dsp_get_sample_rate | ( | const struct ast_dsp * | dsp | ) |
Retrieve the sample rate this DSP structure was created with.
Definition at line 1717 of file dsp.c.
References ast_dsp::sample_rate.
int ast_dsp_get_tcount | ( | struct ast_dsp * | dsp | ) |
Get tcount (Threshold counter)
Definition at line 1903 of file dsp.c.
References ast_dsp::tcount.
Referenced by dahdi_read().
int ast_dsp_get_threshold_from_settings | ( | enum threshold | which | ) |
Get silence threshold from dsp.conf.
Definition at line 1996 of file dsp.c.
References thresholds.
Referenced by actual_load_config(), app_exec(), ast_record_review(), conf_rec_name(), conf_run(), do_waiting(), handle_recordfile(), load_config(), record_exec(), setup_privacy_args(), and talk_detect_fn_write().
int ast_dsp_get_tstate | ( | struct ast_dsp * | dsp | ) |
Get tstate (Tone State)
Definition at line 1898 of file dsp.c.
References ast_dsp::tstate.
Referenced by dahdi_read().
int ast_dsp_getdigits | ( | struct ast_dsp * | dsp, |
char * | buf, | ||
int | max | ||
) |
Get pending DTMF/MF digits.
struct ast_dsp* ast_dsp_new | ( | void | ) |
Allocates a new dsp, assumes 8khz for internal sample rate.
Definition at line 1745 of file dsp.c.
References __ast_dsp_new(), and DEFAULT_SAMPLE_RATE.
Referenced by __ast_play_and_record(), ast_sip_session_alloc(), AST_TEST_DEFINE(), background_detect_exec(), conf_run(), dahdi_new(), detect_write(), do_waiting(), enable_dsp_detect(), fax_detect_new(), fax_session_new(), handle_recordfile(), isAnsweringMachine(), mbl_load_device(), mgcp_new(), misdn_set_opt_exec(), my_dsp_set_digitmode(), ooh323_new(), pjsip_acf_dtmf_mode_write(), read_config(), read_mf_digits(), read_sf_digits(), record_exec(), and wait_exec().
struct ast_dsp* ast_dsp_new_with_rate | ( | unsigned int | sample_rate | ) |
Allocates a new dsp with a specific internal sample rate used during processing.
Definition at line 1750 of file dsp.c.
References __ast_dsp_new().
Referenced by set_softmix_bridge_data(), and set_talk_detect().
Process the audio frame for noise.
dsp | DSP processing audio media. |
f | Audio frame to process. |
totalnoise | Variable to set to the total accumulated noise in ms seen by the DSP since the last silence. |
Definition at line 1488 of file dsp.c.
References ast_dsp_silence_noise_with_energy(), and NULL.
struct ast_frame* ast_dsp_process | ( | struct ast_channel * | chan, |
struct ast_dsp * | dsp, | ||
struct ast_frame * | inf | ||
) |
Return AST_FRAME_NULL frames when there is silence, AST_FRAME_BUSY on busies, and call progress, all dependent upon which features are enabled.
Definition at line 1494 of file dsp.c.
References __ast_dsp_call_progress(), __ast_dsp_silence_noise(), AST_ALAW, ast_alloca, ast_channel_name(), ast_channel_softhangup_internal_flag_add(), AST_CONTROL_ANSWER, AST_CONTROL_BUSY, AST_CONTROL_CONGESTION, AST_CONTROL_HANGUP, AST_CONTROL_RINGING, ast_debug, ast_dsp_busydetect(), ast_format_alaw, ast_format_cache_is_slinear(), ast_format_cmp(), AST_FORMAT_CMP_EQUAL, ast_format_get_name(), ast_format_ulaw, AST_FRAME_CONTROL, AST_FRAME_DTMF, AST_FRAME_DTMF_BEGIN, AST_FRAME_DTMF_END, AST_FRAME_NULL, AST_FRAME_VOICE, ast_frfree, ast_frisolate, AST_LIN2A, AST_LIN2MU, ast_log, AST_MULAW, ast_queue_frame(), AST_SOFTHANGUP_DEV, ast_dsp::ced_tone_state, ast_dsp::cng_tone_state, digit_detect_state_t::current_digits, ast_frame::data, ast_frame::datalen, digit, ast_dsp::digit_state, digit_detect_state_t::digitlen, ast_dsp::digitmode, digit_detect_state_t::digits, ast_dsp::display_inband_dtmf_warning, done, DSP_DIGITMODE_MF, DSP_DIGITMODE_NOQUELCH, DSP_DIGITMODE_RELAXDTMF, DSP_FAXMODE_DETECT_CED, DSP_FAXMODE_DETECT_CNG, DSP_FEATURE_BUSY_DETECT, DSP_FEATURE_CALL_PROGRESS, DSP_FEATURE_DIGIT_DETECT, DSP_FEATURE_FAX_DETECT, DSP_FEATURE_FREQ_DETECT, DSP_FEATURE_SILENCE_SUPPRESS, DSP_FEATURE_WAITDIALTONE, ast_dsp::dtmf_began, dtmf_detect(), fragment_t::end, ast_dsp::f, ast_dsp::faxmode, ast_dsp::features, ast_frame_subclass::format, ast_frame::frametype, ast_dsp::freqmode, ast_dsp::historicnoise, ast_dsp::historicsilence, ast_frame_subclass::integer, ast_frame::len, len(), LOG_WARNING, mf_detect(), ast_dsp::mute_data, ast_dsp::mute_fragments, NULL, ast_frame::ptr, ast_dsp::sample_rate, ast_frame::src, fragment_t::start, ast_frame::subclass, and tone_detect().
Referenced by chan_pjsip_read_stream(), dahdi_read(), detect_callback(), fax_detect_framehook(), mbl_read(), mgcp_rtp_read(), ooh323_rtp_read(), process_ast_dsp(), read_mf_digits(), read_sf_digits(), sip_rtp_read(), and wait_exec().
void ast_dsp_reset | ( | struct ast_dsp * | dsp | ) |
Reset total silence count.
Definition at line 1830 of file dsp.c.
References ast_dsp::freqs, ast_dsp::gsamps, ast_dsp::historicnoise, ast_dsp::historicsilence, ast_dsp::ringtimeout, ast_dsp::totalsilence, goertzel_state_t::v2, and goertzel_state_t::v3.
Referenced by debug_check_frame_for_silence().
void ast_dsp_set_busy_count | ( | struct ast_dsp * | dsp, |
int | cadences | ||
) |
Set number of required cadences for busy.
Definition at line 1780 of file dsp.c.
References ast_dsp::busycount, cadences, and DSP_HISTORY.
Referenced by dahdi_new().
void ast_dsp_set_busy_pattern | ( | struct ast_dsp * | dsp, |
const struct ast_dsp_busy_pattern * | cadence | ||
) |
Set expected lengths of the busy tone.
Definition at line 1791 of file dsp.c.
References ast_debug, ast_dsp::busy_cadence, ast_dsp_busy_pattern::length, and ast_dsp_busy_pattern::pattern.
Referenced by dahdi_new().
int ast_dsp_set_call_progress_zone | ( | struct ast_dsp * | dsp, |
char * | zone | ||
) |
Set zone for doing progress detection.
Definition at line 1879 of file dsp.c.
References aliases, ARRAY_LEN, ast_dsp_prog_reset(), progalias::mode, progalias::name, and ast_dsp::progmode.
Referenced by dahdi_new().
int ast_dsp_set_digitmode | ( | struct ast_dsp * | dsp, |
int | digitmode | ||
) |
Set digit mode.
Definition at line 1844 of file dsp.c.
References ast_digit_detect_init(), ast_dsp::digit_state, ast_dsp::digitmode, DSP_DIGITMODE_DTMF, DSP_DIGITMODE_MF, DSP_DIGITMODE_MUTECONF, DSP_DIGITMODE_MUTEMAX, and ast_dsp::sample_rate.
Referenced by analog_ss_thread(), dahdi_hangup(), dahdi_new(), dahdi_setoption(), enable_dsp_detect(), mbl_load_device(), mgcp_new(), mkintf(), my_dsp_set_digitmode(), ooh323_new(), and read_mf_digits().
int ast_dsp_set_faxmode | ( | struct ast_dsp * | dsp, |
int | faxmode | ||
) |
Set fax mode.
Definition at line 1870 of file dsp.c.
References ast_fax_detect_init(), and ast_dsp::faxmode.
Referenced by fax_detect_new(), and ooh323_new().
void ast_dsp_set_features | ( | struct ast_dsp * | dsp, |
int | features | ||
) |
Select feature set.
Definition at line 1755 of file dsp.c.
References ast_dsp::display_inband_dtmf_warning, DSP_FEATURE_DIGIT_DETECT, and ast_dsp::features.
Referenced by ast_sip_session_alloc(), chan_pjsip_cng_tone_detected(), chan_pjsip_read_stream(), dahdi_dtmf_detect_disable(), dahdi_dtmf_detect_enable(), dahdi_handle_dtmf(), dahdi_new(), dahdi_read(), dahdi_setoption(), detect_write(), enable_dsp_detect(), fax_detect_new(), mbl_load_device(), mgcp_new(), misdn_set_opt_exec(), my_handle_dtmf(), my_new_analog_ast_channel(), ooh323_new(), pjsip_acf_dtmf_mode_write(), read_config(), read_mf_digits(), read_sf_digits(), set_caps(), sip_rtp_read(), and wait_exec().
int ast_dsp_set_freqmode | ( | struct ast_dsp * | dsp, |
int | freq1, | ||
int | dur, | ||
int | db, | ||
int | squelch | ||
) |
Set arbitrary frequency detection mode.
Definition at line 1859 of file dsp.c.
References ast_freq_detect_init(), and ast_dsp::freqmode.
Referenced by detect_write(), read_sf_digits(), and wait_exec().
void ast_dsp_set_threshold | ( | struct ast_dsp * | dsp, |
int | threshold | ||
) |
Set the minimum average magnitude threshold to determine talking by the DSP.
Definition at line 1775 of file dsp.c.
References ast_dsp::threshold.
Referenced by __ast_play_and_record(), do_waiting(), fax_session_new(), handle_recordfile(), isAnsweringMachine(), record_exec(), set_softmix_bridge_data(), and set_talk_detect().
Process the audio frame for silence.
dsp | DSP processing audio media. |
f | Audio frame to process. |
totalsilence | Variable to set to the total accumulated silence in ms seen by the DSP since the last noise. |
Definition at line 1483 of file dsp.c.
References ast_dsp_silence_noise_with_energy(), and NULL.
Referenced by __ast_play_and_record(), background_detect_exec(), conf_run(), debug_check_frame_for_silence(), handle_recordfile(), isAnsweringMachine(), record_exec(), and talk_detect_audiohook_cb().
int ast_dsp_silence_with_energy | ( | struct ast_dsp * | dsp, |
struct ast_frame * | f, | ||
int * | totalsilence, | ||
int * | frames_energy | ||
) |
Process the audio frame for silence.
dsp | DSP processing audio media. |
f | Audio frame to process. |
totalsilence | Variable to set to the total accumulated silence in ms seen by the DSP since the last noise. |
frames_energy | Variable to set to the average energy of the samples in the frame. |
Definition at line 1478 of file dsp.c.
References ast_dsp_silence_noise_with_energy().
Referenced by softmix_bridge_write_voice().
int ast_dsp_was_muted | ( | struct ast_dsp * | dsp | ) |
Returns true if DSP code was muting any fragment of the last processed frame. Muting (squelching) happens when DSP code removes DTMF/MF/generic tones from the audio.
Definition at line 1893 of file dsp.c.
References ast_dsp::mute_fragments.
Referenced by dahdi_read().