spandsp  0.0.6
private/silence_gen.h
1 /*
2  * SpanDSP - a series of DSP components for telephony
3  *
4  * private/silence_gen.c - A silence generator, for inserting timed silences.
5  *
6  * Written by Steve Underwood <steveu@coppice.org>
7  *
8  * Copyright (C) 2006 Steve Underwood
9  *
10  * All rights reserved.
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU Lesser General Public License version 2.1,
14  * as published by the Free Software Foundation.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public
22  * License along with this program; if not, write to the Free Software
23  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24  */
25 
26 #if !defined(_SPANDSP_PRIVATE_SILENCE_GEN_H_)
27 #define _SPANDSP_PRIVATE_SILENCE_GEN_H_
28 
30 {
31  /*! \brief The callback function used to report status changes. */
33  /*! \brief A user specified opaque pointer passed to the status function. */
35 
36  int remaining_samples;
37  int total_samples;
38 };
39 
40 #endif
41 /*- End of file ------------------------------------------------------------*/
SIG_TONE_2_PRESENT
@ SIG_TONE_2_PRESENT
Definition: sig_tone.h:74
sig_tone_rx_state_s
Definition: private/sig_tone.h:156
noise
int16_t noise(noise_state_t *s)
Generate a sample of audio noise.
Definition: noise.c:52
SIG_TONE_2600HZ
@ SIG_TONE_2600HZ
Definition: sig_tone.h:61
dds_mod
int16_t dds_mod(uint32_t *phase_acc, int32_t phase_rate, int16_t scale, int32_t phase)
Generate an integer tone sample, with modulation.
Definition: dds_int.c:378
modem_status_func_t
void(* modem_status_func_t)(void *user_data, int status)
Definition: async.h:114
async.h
power_meter_current_dbm0
float power_meter_current_dbm0(power_meter_t *s)
Get the current power meter reading, in dBm0.
Definition: power_meter.c:120
dds_phase_rate
int32_t dds_phase_rate(float frequency)
Find the phase rate value to achieve a particular frequency.
Definition: dds_int.c:316
sig_tone_rx_set_mode
void sig_tone_rx_set_mode(sig_tone_rx_state_t *s, int mode, int duration)
Set the receive mode.
Definition: sig_tone.c:626
dds_scaling_dbm0
int16_t dds_scaling_dbm0(float level)
Find the scaling factor needed to achieve a specified level in dBm0.
Definition: dds_int.c:328
silence_gen_state_s
Definition: private/silence_gen.h:29
awgn_state_s
Definition: private/awgn.h:32
power_meter_update
int32_t power_meter_update(power_meter_t *s, int16_t amp)
Update a power meter.
Definition: power_meter.c:84
SIG_TONE_RX_FILTER_TONE
@ SIG_TONE_RX_FILTER_TONE
Definition: sig_tone.h:83
silence_gen_state_s::status_user_data
void * status_user_data
A user specified opaque pointer passed to the status function.
Definition: private/silence_gen.h:34
SPAN_DECLARE_NONSTD
SPAN_DECLARE_NONSTD(int) async_tx_get_bit(void *user_data)
Get the next bit of a transmitted serial bit stream.
power_meter_t
Definition: power_meter.h:48
sig_tone_tx_set_mode
void sig_tone_tx_set_mode(sig_tone_tx_state_t *s, int mode, int duration)
Set the tone mode.
Definition: sig_tone.c:299
SIG_STATUS_SHUTDOWN_COMPLETE
@ SIG_STATUS_SHUTDOWN_COMPLETE
A modem has completed its task, and shut down.
Definition: async.h:77
silence_gen_always
void silence_gen_always(silence_gen_state_t *s)
Set a silence generator context to output continuous silence.
Definition: silence_gen.c:73
SIG_TONE_TX_UPDATE_REQUEST
@ SIG_TONE_TX_UPDATE_REQUEST
Definition: sig_tone.h:85
SIG_TONE_2400HZ_2600HZ
@ SIG_TONE_2400HZ_2600HZ
Definition: sig_tone.h:63
sig_tone_tx
int sig_tone_tx(sig_tone_tx_state_t *s, int16_t amp[], int len)
Generate a block of signalling tone audio samples.
Definition: sig_tone.c:222
silence_gen_set
void silence_gen_set(silence_gen_state_t *s, int silent_samples)
Set a silence generator context to output a specified period of silence.
Definition: silence_gen.c:79
silence_gen_status_handler
void silence_gen_status_handler(silence_gen_state_t *s, modem_status_func_t handler, void *user_data)
Change the status reporting function associated with a silence generator context.
Definition: silence_gen.c:111
sig_tone_tx_init
sig_tone_tx_state_t * sig_tone_tx_init(sig_tone_tx_state_t *s, int tone_type, tone_report_func_t sig_update, void *user_data)
Initialise a signalling tone context.
Definition: sig_tone.c:319
template_t
Definition: sig_tone_tests.c:72
codec_munge_state_s
Definition: test_utils.c:53
sig_tone_rx_state_s::user_data
void * user_data
A user specified opaque pointer passed to the callback function.
Definition: private/sig_tone.h:161
sig_tone_rx
int sig_tone_rx(sig_tone_rx_state_t *s, int16_t amp[], int len)
Process a block of received audio samples.
Definition: sig_tone.c:368
silence_gen_remainder
int silence_gen_remainder(silence_gen_state_t *s)
Find how long a silence generator context has to run.
Definition: silence_gen.c:99
SIG_TONE_2280HZ
@ SIG_TONE_2280HZ
Definition: sig_tone.h:59
spandsp-sim.h
silence_gen_alter
void silence_gen_alter(silence_gen_state_t *s, int silent_samples)
Alter the period of a silence generator context by a specified amount.
Definition: silence_gen.c:86
SIG_TONE_2_CHANGE
@ SIG_TONE_2_CHANGE
Definition: sig_tone.h:76
silence_gen_generated
int silence_gen_generated(silence_gen_state_t *s)
Find the total silence generated to date.
Definition: silence_gen.c:105
SIG_TONE_TX_PASSTHROUGH
@ SIG_TONE_TX_PASSTHROUGH
Definition: sig_tone.h:78
SIG_TONE_1_PRESENT
@ SIG_TONE_1_PRESENT
Definition: sig_tone.h:70
silence_gen_state_s::status_handler
modem_status_func_t status_handler
The callback function used to report status changes.
Definition: private/silence_gen.h:32
sig_tone_rx_init
sig_tone_rx_state_t * sig_tone_rx_init(sig_tone_rx_state_t *s, int tone_type, tone_report_func_t sig_update, void *user_data)
Initialise a signalling tone context.
Definition: sig_tone.c:632
logging.h
SIG_TONE_RX_PASSTHROUGH
@ SIG_TONE_RX_PASSTHROUGH
Definition: sig_tone.h:80
span_dummy_mod
int span_dummy_mod(void *user_data, int16_t amp[], int len)
Dummy signal modifier callback.
Definition: silence_gen.c:154
swept_tone_state_s
Definition: private/swept_tone.h:29
silence_gen_init
silence_gen_state_t * silence_gen_init(silence_gen_state_t *s, int silent_samples)
Initialise a timed silence generator context.
Definition: silence_gen.c:118
SIG_TONE_1_CHANGE
@ SIG_TONE_1_CHANGE
Definition: sig_tone.h:72
power_meter_init
power_meter_t * power_meter_init(power_meter_t *s, int shift)
Initialise a power meter context.
Definition: power_meter.c:50
sig_tone_tx_state_s
Definition: private/sig_tone.h:125