<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:courier,monaco,monospace,sans-serif;font-size:12pt">The algorithm used is not so great and could stand to be replaced<br>by a better one if we get the chance.<br><br>basically we decode the audio to signed linear 16bit samples<br>for each packet we receive and iterate the samples and add up the<br>absolute values then compute the average and compare it to the <br>acceptable level considered "talking" then we use a counter to make<br>sure it's in the same state several times in a row before actually<br>changing the status of the channel to talking or not talking.<br><br><br>A real vad algorithm would also be able to filter out the voice from<br>the background noise and judge the energy based only on that.<br><br><br><br><br><br><br><div>&nbsp;</div><div>Anthony Minessale II<br><br><span>FreeSWITCH <a target="_blank"
 href="http://www.freeswitch.org/">http://www.freeswitch.org/</a></span><br><span>ClueCon <a target="_blank" href="http://www.cluecon.com/">http://www.cluecon.com/</a></span><br><br>AIM: anthm<br>MSN:anthony_minessale@hotmail.com<br>GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<br>IRC: irc.freenode.net #freeswitch</div><div><br>FreeSWITCH Developer Conference<br>sip:888@conference.freeswitch.org<br>iax:guest@conference.freeswitch.org/888<br>googletalk:conf+888@conference.freeswitch.org<br>pstn:213-799-1400</div><div style="font-family: courier,monaco,monospace,sans-serif; font-size: 12pt;"><br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: KMTDBOURSE &lt;kmtdbourse@free.fr&gt;<br>To: freeswitch-dev@lists.freeswitch.org<br>Sent: Thursday, February 14, 2008 1:51:55 PM<br>Subject: Re: [Freeswitch-dev] VAD, TALK and NOTALK events<br><br>


<font color="#0000ff">Hi,<br><br>
&nbsp;&nbsp; I ma interested in the VAD algorithm used where where is the
code exactly? maybe a link any document support about the vad alogorithm
used therein?<br>
&nbsp;&nbsp; <br>
&nbsp;&nbsp; thanks,<br><br>
<br>
Zelda<br>
&nbsp;<br><br>
</font>At 01:47 14/02/2008, Anthony Minessale wrote:<br>
<blockquote type="cite" class="cite" cite="">They are enabled by the vad
params in the sofia profile xml<br>
&lt;param name="vad"&gt;<br><br>
&nbsp;<br>
Anthony Minessale II<br><br>
FreeSWITCH
<a rel="nofollow" target="_blank" href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>
ClueCon
<a rel="nofollow" target="_blank" href="http://www.cluecon.com/">http://www.cluecon.com/</a><br><br>
AIM: anthm<br>
MSN:anthony_minessale@hotmail.com<br>
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<br>
IRC: <a target="_blank" href="http://irc.freenode.net">irc.freenode.net</a> #freeswitch<br><br>
FreeSWITCH Developer Conference<br>
sip:888@conference.freeswitch.org<br>
iax:guest@conference.freeswitch.org/888<br>
googletalk:conf+888@conference.freeswitch.org<br>
pstn:213-799-1400<br><br>
<br>
----- Original Message ----<br>
From: Cesar Cepeda &lt;cesar@auronix.com&gt;<br>
To: freeswitch-dev@lists.freeswitch.org<br>
Sent: Wednesday, February 13, 2008 10:17:23 AM<br>
Subject: Re: [Freeswitch-dev] VAD, TALK and NOTALK events<br><br>
Please correct me if I’m wrong.&nbsp; <br><br>
&nbsp;<br><br>
The events are indeed fired, but only if the SWITCH_VAD_FLAG_EVENTS_TALK
or NOTALK flags are set for an rtp_session.&nbsp;&nbsp; I found no place
in the code where those flags are set.&nbsp; That is what I meant by
not&nbsp; being “enabled”.<br><br>
&nbsp;<br><br>
I subscribed to the events and received nothing.&nbsp; Then I set the
flags on switch_rtp_enable_vad function, and then I started receiving the
events.&nbsp; Perhaps there is another way of doing it that I’m
missing.<br><br>
&nbsp;<br><br>
Cesar Cepeda.<br><br>
&nbsp;<br><br>
&nbsp;<br><br>
&nbsp;<br><br>
<b>De:</b> freeswitch-dev-bounces@lists.freeswitch.org
[<a rel="nofollow" ymailto="mailto:freeswitch-dev-bounces@lists.freeswitch.org" target="_blank" href="mailto:freeswitch-dev-bounces@lists.freeswitch.org">
mailto:freeswitch-dev-bounces@lists.freeswitch.org</a>] <b>En nombre de
</b>Anthony Minessale<br>
<b>Enviado el:</b> Miércoles, 13 de Febrero de 2008 08:17<br>
<b>Para:</b> freeswitch-dev@lists.freeswitch.org<br>
<b>Asunto:</b> Re: [Freeswitch-dev] VAD, TALK and NOTALK events<br><br>
&nbsp;<br><br>
The events are fired.<br>
I don't know what you mean by "enabled"<br><br>
You can either bind an event to a callback<br>
in the load function of your custom module.<br><br>
or connect to mod_event_socket on tcp<br>
and request "events talk notalk"<br><br>
void my_event_handler(switch_event_t *event)<br>
{<br><br>
}<br><br>
if (switch_event_bind(modname, SWITCH_EVENT_TALK,
SWITCH_EVENT_SUBCLASS_ANY, my_event_handler, NULL)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; != SWITCH_STATUS_SUCCESS)
{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't
bind!\n");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return
SWITCH_STATUS_GENERR;<br>
&nbsp;&nbsp;&nbsp; }<br><br>
if (switch_event_bind(modname, SWITCH_EVENT_NOTALK,
SWITCH_EVENT_SUBCLASS_ANY, my_event_handler, NULL)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; != SWITCH_STATUS_SUCCESS)
{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't
bind!\n");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return
SWITCH_STATUS_GENERR;<br>
&nbsp;&nbsp;&nbsp; }<br><br>
&nbsp;<br><br>
Anthony Minessale II<br><br>
FreeSWITCH
<a rel="nofollow" target="_blank" href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>
ClueCon
<a rel="nofollow" target="_blank" href="http://www.cluecon.com/">http://www.cluecon.com/</a><br><br>
AIM: anthm<br>
MSN:anthony_minessale@hotmail.com<br>
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<br>
IRC: <a rel="nofollow" target="_blank" href="http://irc.freenode.net">irc.freenode.net</a>
#freeswitch<br><br>
<br>
FreeSWITCH Developer Conference<br>
sip:888@conference.freeswitch.org<br>
iax:guest@conference.freeswitch.org/888<br>
googletalk:conf+888@conference.freeswitch.org<br>
pstn:213-799-1400<br><br>
&nbsp;<br><br>
----- Original Message ----<br>
From: Cesar Cepeda &lt;cesar@auronix.com&gt;<br>
To: freeswitch-dev@lists.freeswitch.org<br>
Sent: Tuesday, February 12, 2008 6:53:03 PM<br>
Subject: [Freeswitch-dev] VAD, TALK and NOTALK events<br><br>
Hi,<br><br>
&gt;From looking at the code of switch_rtp.c&nbsp; I can see that VAD is
done if<br>
enabled in the sip profile in order to not send packets when there is
no<br>
noise. There are also two events {TALK, NOTALK} which can be fired when
VAD<br>
kicks in, nevertheless these two events are enabled nowhere (or at least
I<br>
didn't find a place in the code where they were enabled), so no matter
if<br>
you ask for them you don't receive them.&nbsp; My questions are the
following:<br><br>
Is there some particular reason for not enabling these two events?&nbsp;
<br>
Is the event queue easily overflowed if these two events are
enabled?<br><br>
Thanks.<br><br>
Cesar Cepeda.<br><br>
<br>
_______________________________________________<br>
Freeswitch-dev mailing list<br>
<a rel="nofollow" ymailto="mailto:Freeswitch-dev@lists.freeswitch.org" target="_blank" href="mailto:Freeswitch-dev@lists.freeswitch.org">
Freeswitch-dev@lists.freeswitch.org</a><br>
<a rel="nofollow" target="_blank" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev">
http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a rel="nofollow" target="_blank" href="http://lists.freeswitch.org/mailman/options/freeswitch-dev">
http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a rel="nofollow" target="_blank" href="http://www.freeswitch.org">http://www.freeswitch.org</a><br><br>
&nbsp;<br><br>
&nbsp;<br>
<div align="center"><br>
</div>
Never miss a thing.
<a rel="nofollow" target="_blank" href="http://us.rd.yahoo.com/evt=51438/*http:/www.yahoo.com/r/hs">Make
Yahoo your homepage.</a> <br><br>
<br>
-----Inline Attachment Follows-----<br><br>
_______________________________________________<br>
Freeswitch-dev mailing list<br>
<a rel="nofollow" ymailto="mailto:Freeswitch-dev@lists.freeswitch.org" target="_blank" href="mailto:Freeswitch-dev@lists.freeswitch.org">
Freeswitch-dev@lists.freeswitch.org</a><br>
<a rel="nofollow" target="_blank" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev">
http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a rel="nofollow" target="_blank" href="http://lists.freeswitch.org/mailman/options/freeswitch-dev">
http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a rel="nofollow" target="_blank" href="http://www.freeswitch.org">http://www.freeswitch.org</a><br><br>
<br>
<br>
Looking for last minute shopping deals?
<a rel="nofollow" target="_blank" href="http://us.rd.yahoo.com/evt=51734/*http://tools.search.yahoo.com/newsearch/category.php?category=shopping">
Find them fast with Yahoo! Search.</a> <br>
_______________________________________________<br>
Freeswitch-dev mailing list<br>
Freeswitch-dev@lists.freeswitch.org<br>
<a rel="nofollow" target="_blank" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev">
http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a target="_blank" href="http://lists.freeswitch.org/mailman/options/freeswitch-dev">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a rel="nofollow" target="_blank" href="http://www.freeswitch.org/">
http://www.freeswitch.org</a></blockquote><!-- kill --><div><br><br>-----Inline Attachment Follows-----<br><br>_______________________________________________<br>Freeswitch-dev 
mailing 
list<br><a ymailto="mailto:Freeswitch-dev@lists.freeswitch.org" href="mailto:Freeswitch-dev@lists.freeswitch.org">Freeswitch-dev@lists.freeswitch.org</a><br><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br></div></div><br></div></div><br>

      <hr size=1>Never miss a thing.  <a href="http://us.rd.yahoo.com/evt=51438/*http://www.yahoo.com/r/hs"> Make Yahoo your homepage.</a>

</body></html>