Detecting Energy Levels on a Channel with mod_lua
Is there anyway to detect energy levels on a channel that is being controlled by mod_lua? Please point me in the right direction if there is. Thanks. --matt
On Sun, Feb 28, 2010 at 3:36 AM, Matthew Fong <mattdfong@gmail.com> wrote:
Is there anyway to detect energy levels on a channel that is being controlled by mod_lua? Please point me in the right direction if there is. Thanks.
Is there a way to do it on a channel that is not controlled by Lua?! -MC
An easy way is to do an average of the absolute value of each L16 sample over a period of time. Im not quite sure how to access audio channels from within Lua but if you are in C you can use switch_core_session_read_frame() to get audio frames. Mathieu Rene Avant-Garde Solutions Inc Office: + 1 (514) 664-1044 x100 Cell: +1 (514) 664-1044 x200 mrene@avgs.ca On 1-Mar-10, at 5:29 PM, Michael Collins wrote:
On Sun, Feb 28, 2010 at 3:36 AM, Matthew Fong <mattdfong@gmail.com> wrote: Is there anyway to detect energy levels on a channel that is being controlled by mod_lua? Please point me in the right direction if there is. Thanks.
Is there a way to do it on a channel that is not controlled by Lua?! -MC
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
On Mon, Mar 1, 2010 at 2:59 PM, Mathieu Rene <mrene_lists@avgs.ca> wrote:
An easy way is to do an average of the absolute value of each L16 sample over a period of time. Im not quite sure how to access audio channels from within Lua but if you are in C you can use switch_core_session_read_frame() to get audio frames.
Show off! :) Related question: do media bugs allow you to access this kind of information? Just curious... -MC
Media bugs allow you to get a channel's audio so you can use that yeah. Mathieu Rene Avant-Garde Solutions Inc Office: + 1 (514) 664-1044 x100 Cell: +1 (514) 664-1044 x200 mrene@avgs.ca On 1-Mar-10, at 7:15 PM, Michael Collins wrote:
On Mon, Mar 1, 2010 at 2:59 PM, Mathieu Rene <mrene_lists@avgs.ca> wrote: An easy way is to do an average of the absolute value of each L16 sample over a period of time. Im not quite sure how to access audio channels from within Lua but if you are in C you can use switch_core_session_read_frame() to get audio frames.
Show off! :) Related question: do media bugs allow you to access this kind of information? Just curious... -MC
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
What's a "media bug"? From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Michael Collins Sent: Monday, March 01, 2010 6:15 PM To: freeswitch-users@lists.freeswitch.org Subject: Re: [Freeswitch-users] Detecting Energy Levels on a Channel with mod_lua On Mon, Mar 1, 2010 at 2:59 PM, Mathieu Rene <mrene_lists@avgs.ca> wrote: An easy way is to do an average of the absolute value of each L16 sample over a period of time. Im not quite sure how to access audio channels from within Lua but if you are in C you can use switch_core_session_read_frame() to get audio frames. Show off! :) Related question: do media bugs allow you to access this kind of information? Just curious... -MC
A media bug is a way to get a channel's audio inside a module, you can have read, write and read_replace/write_replace bugs (those can actually change the audio). Its what record_session uses to be able to record the call to a file while its executing other applications. Other examples are... tone_detect, start_dtmf, eavesdrop... Mathieu Rene Avant-Garde Solutions Inc Office: + 1 (514) 664-1044 x100 Cell: +1 (514) 664-1044 x200 mrene@avgs.ca On 1-Mar-10, at 7:31 PM, Peder wrote:
What’s a “media bug”?
From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org ] On Behalf Of Michael Collins Sent: Monday, March 01, 2010 6:15 PM To: freeswitch-users@lists.freeswitch.org Subject: Re: [Freeswitch-users] Detecting Energy Levels on a Channel with mod_lua
On Mon, Mar 1, 2010 at 2:59 PM, Mathieu Rene <mrene_lists@avgs.ca> wrote: An easy way is to do an average of the absolute value of each L16 sample over a period of time. Im not quite sure how to access audio channels from within Lua but if you are in C you can use switch_core_session_read_frame() to get audio frames.
Show off! :) Related question: do media bugs allow you to access this kind of information? Just curious... -MC
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (4)
-
Mathieu Rene
-
Matthew Fong
-
Michael Collins
-
Peder