[pjsip] quick question about volume and PJSUA-LIB
C R McClenaghan
chris at mcclenaghan.com
Fri Mar 6 20:35:03 EST 2009
Hey Jim,
Thanks, I may need this. I was able to modify the pjsua sample
application to accept first a conference port number and then a volume
adjust. It had previously been hardcoded to port 0 - but, hey, its a
sample program. Anyway it now defaults to 0 but you can specify other
ports and a listing of active ports is provided ala the connect/
disconnect dialog.
I'm going to insert your update and see how I like it. Can you tell
which library contains min and max, I'm getting a load error on the
build.
Thanks,
Chris
On Mar 6, 2009, at 4:52 PM, Jim Gomes wrote:
> Hi Chris,
>
> I was doing some work in this area last week for one of my own
> projects. I had great difficulty with this part of the library as
> well. I eventually patched it to the following to get it to work.
>
> /*
> * Adjust the signal level to be transmitted from the bridge to the
> * specified port by making it louder or quieter.
> */
> PJ_DEF(pj_status_t) pjsua_conf_adjust_tx_level(pjsua_conf_port_id
> slot,
> float level)
> {
> int newlevel = max(0, min(255, (int) level));
> return pjmedia_conf_adjust_tx_level(pjsua_var.mconf, slot,
> newlevel - 128);
> }
>
> /*
> * Adjust the signal level to be received from the specified port (to
> * the bridge) by making it louder or quieter.
> */
> PJ_DEF(pj_status_t) pjsua_conf_adjust_rx_level(pjsua_conf_port_id
> slot,
> float level)
> {
> int newlevel = max(0, min(255, (int) level));
> return pjmedia_conf_adjust_rx_level(pjsua_var.mconf, slot,
> newlevel - 128);
> }
>
>
> With this implementation, the level parameter has a valid range of 0
> to 255, with 0 being mute. Feel free to patch your version of the
> code, because the existing implementation is broken.
>
> Regards,
> Jim Gomes
>
> From: pjsip-bounces at lists.pjsip.org [mailto:pjsip-bounces at lists.pjsip.org
> ] On Behalf Of C R McClenaghan
> Sent: Friday, 06 March, 2009 2:42 PM
> To: pjsip list
> Subject: [pjsip] quick question about volume and PJSUA-LIB
>
> All,
>
> Here's the documentation from online:
>
> pj_status_t pjsua_conf_adjust_rx_level
> (
> pjsua_conf_port_id
> slot,
> float
> level
>
> )
> Adjust the signal level to be received from the specified port (to
> the bridge) by making it louder or quieter.
>
>
> Parameters:
> slot
> The conference bridge slot number.
> level
> Signal level adjustment. Value 1.0 means no level adjustment, while
> value 0 means to mute the port.
> Returns:
> PJ_SUCCESS on success, or the appropriate error code.
>
> So, what are the appropriate ranges for the value of level? Are they
> 0 to 1? Are the values absolutes or relative to current volume? I'm
> playing with pjsua application and not sure I can tell. I'd like to
> see how fine grain the control can be.
>
> Thanks,
>
> Chris
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20090306/a0ad47f3/attachment-0001.html>
More information about the pjsip
mailing list