Processing Live Audio during a call between 2 extensions
Dear Freeswitch Developers, i am relatively new to freeswitch and i am seeking some advice. I am creating an External Application that does some [live] processing on the Audio of the freeswitch call before sending it to the second Call Leg, and vice versa. Can you please direct me to the best way to do that and how to access/capture the live audio channel in both legs while it is streaming, and how to resubmit it again to the other leg? I read the book about freeswitch, but still couldnt figure the best approach to do that, any hint is appreciated. Best Regards, Michel Habib.
It was hinted on IRC that media bugs may be the way to go. It all depends on what exactly you're trying to do. Read FreeSWITCH -> Modules -> Core Library -> Media Bugs on http://docs.freeswitch.org/ and see if they sound the way to go. In particular this may be what you need: SWITCH_DECLARE<http://docs.freeswitch.org/group__mb1.html#gf0ebe1244a6a3937e9fa039eb91b3325>( switch_frame_t <http://docs.freeswitch.org/structswitch__frame.html> *) switch_core_media_bug_get_write_replace_frame(_In_ switch_media_bug_t<http://docs.freeswitch.org/structswitch__media__bug.html>* bug<http://docs.freeswitch.org/group__mb1.html#g2a620e89890bd1e0e9ccd08954d361b1> ) Obtain a replace frame from a media bug. You'll write a module in C that when loaded registeres a callback with FS. Any channel using the media bug will get the audio decoded, given to the media bug. Your app will process the audio and replace it, then FS will encode and send the replacement. Decoded audio will be a data buffer containing L16 (WAV) samples. -Steve On 14 January 2011 16:44, Michel Habib <michelhabib@gmail.com> wrote:
Dear Freeswitch Developers, i am relatively new to freeswitch and i am seeking some advice.
I am creating an External Application that does some [live] processing on the Audio of the freeswitch call before sending it to the second Call Leg, and vice versa. Can you please direct me to the best way to do that and how to access/capture the live audio channel in both legs while it is streaming, and how to resubmit it again to the other leg? I read the book about freeswitch, but still couldnt figure the best approach to do that, any hint is appreciated.
Best Regards, Michel Habib.
_______________________________________________ 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
Hi, Your best way is to make a freeswitch module and attach a media bug to the channel, you can take a look at mod_soundtouch's source, which sets one up (using switch_core_media_bug_add()) and changes the audio. Mathieu Rene Avant-Garde Solutions Inc Office: + 1 (514) 664-1044 x100 Cell: +1 (514) 664-1044 x200 mrene@avgs.ca On 2011-01-14, at 11:44 AM, Michel Habib wrote:
Dear Freeswitch Developers, i am relatively new to freeswitch and i am seeking some advice.
I am creating an External Application that does some [live] processing on the Audio of the freeswitch call before sending it to the second Call Leg, and vice versa. Can you please direct me to the best way to do that and how to access/capture the live audio channel in both legs while it is streaming, and how to resubmit it again to the other leg? I read the book about freeswitch, but still couldnt figure the best approach to do that, any hint is appreciated.
Best Regards, Michel Habib. _______________________________________________ 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 (3)
-
Mathieu Rene
-
Michel Habib
-
Steven Ayre