aboutsummaryrefslogtreecommitdiffstats
path: root/funcs/func_speex.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-01 21:10:07 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-01 21:10:07 +0000
commitb1f91b97d2085cc845d0f57bd9907de50c995105 (patch)
tree9c836ac808552d20be6bd2baa3a3c29f642eda53 /funcs/func_speex.c
parentc5d084051f21e943fcbcc347fc80b166885f298d (diff)
Merge changes from team/group/appdocsxml
This commit introduces the first phase of an effort to manage documentation of the interfaces in Asterisk in an XML format. Currently, a new format is available for applications and dialplan functions. A good number of conversions to the new format are also included. For more information, see the following message to asterisk-dev: http://lists.digium.com/pipermail/asterisk-dev/2008-October/034968.html git-svn-id: http://svn.digium.com/svn/asterisk/trunk@153365 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs/func_speex.c')
-rw-r--r--funcs/func_speex.c73
1 files changed, 46 insertions, 27 deletions
diff --git a/funcs/func_speex.c b/funcs/func_speex.c
index 4ddfab80b..6858cf7a3 100644
--- a/funcs/func_speex.c
+++ b/funcs/func_speex.c
@@ -48,6 +48,52 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#define DEFAULT_AGC_LEVEL 8000.0
+/*** DOCUMENTATION
+ <function name="AGC" language="en_US">
+ <synopsis>
+ Apply automatic gain control to audio on a channel.
+ </synopsis>
+ <syntax>
+ <parameter name="channeldirection" required="true">
+ <para>This can be either <literal>rx</literal> or <literal>tx</literal></para>
+ </parameter>
+ </syntax>
+ <description>
+ <para>The AGC function will apply automatic gain control to the audio on the
+ channel that it is executed on. Using <literal>rx</literal> for audio recieved
+ and <literal>tx</literal> for audio transmitted to the channel. When using this
+ function you set a target audio level. It is primarly intended for use with
+ analog lines, but could be useful for other channels as well. The target volume
+ is set with a number between <literal>1-32768</literal>. The larger the number
+ the louder (more gain) the channel will recieve.</para>
+ <para>Examples:</para>
+ <para>exten => 1,1,Set(AGC(rx)=8000)</para>
+ <para>exten => 1,2,Set(AGC(tx)=off)</para>
+ </description>
+ </function>
+ <function name="DENOISE" language="en_US">
+ <synopsis>
+ Apply noise reduction to audio on a channel.
+ </synopsis>
+ <syntax>
+ <parameter name="channeldirection" required="true">
+ <para>This can be either <literal>rx</literal> or <literal>tx</literal>
+ the values that can be set to this are either <literal>on</literal> and
+ <literal>off</literal></para>
+ </parameter>
+ </syntax>
+ <description>
+ <para>The DENOISE function will apply noise reduction to audio on the channel
+ that it is executed on. It is very useful for noisy analog lines, especially
+ when adjusting gains or using AGC. Use <literal>rx</literal> for audio received from the channel
+ and <literal>tx</literal> to apply the filter to the audio being sent to the channel.</para>
+ <para>Examples:</para>
+ <para>exten => 1,1,Set(DENOISE(rx)=on)</para>
+ <para>exten => 1,2,Set(DENOISE(tx)=off)</para>
+ </description>
+ </function>
+ ***/
+
struct speex_direction_info {
SpeexPreprocessState *state; /*!< speex preprocess state object */
int agc; /*!< audio gain control is enabled or not */
@@ -290,39 +336,12 @@ static int speex_read(struct ast_channel *chan, const char *cmd, char *data, cha
static struct ast_custom_function agc_function = {
.name = "AGC",
- .synopsis = "Apply automatic gain control to audio on a channel",
- .desc =
- " The AGC function will apply automatic gain control to audio on the channel\n"
- "that this function is executed on. Use rx for audio received from the channel\n"
- "and tx to apply AGC to the audio being sent to the channel. When using this\n"
- "function, you set a target audio level. It is primarily intended for use with\n"
- "analog lines, but could be useful for other channels, as well. The target volume\n"
- "is set with a number between 1 and 32768. Larger numbers are louder.\n"
- " Example Usage:\n"
- " Set(AGC(rx)=8000)\n"
- " Set(AGC(tx)=8000)\n"
- " Set(AGC(rx)=off)\n"
- " Set(AGC(tx)=off)\n"
- "",
.write = speex_write,
.read = speex_read
};
static struct ast_custom_function denoise_function = {
.name = "DENOISE",
- .synopsis = "Apply noise reduction to audio on a channel",
- .desc =
- " The DENOISE function will apply noise reduction to audio on the channel\n"
- "that this function is executed on. It is especially useful for noisy analog\n"
- "lines, especially when adjusting gains or using AGC. Use rx for audio\n"
- "received from the channel and tx to apply the filter to the audio being sent\n"
- "to the channel.\n"
- " Example Usage:\n"
- " Set(DENOISE(rx)=on)\n"
- " Set(DENOISE(tx)=on)\n"
- " Set(DENOISE(rx)=off)\n"
- " Set(DENOISE(tx)=off)\n"
- "",
.write = speex_write,
.read = speex_read
};