quick question about volume and PJSUA-LIB

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx [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: quick question about volume and PJSUA-LIB

All,

Here's the documentation from online:

pj_status_t<http://www.pjsip.org/pjlib/docs/html/group__PJ__BASIC.htm#gb43ba3167bd2a2ab4580509dbf79200e> pjsua_conf_adjust_rx_level

(

pjsua_conf_port_id<http://www.pjsip.org/pjsip/docs/html/group__PJSUA__LIB__BASE.htm#gf5d44947e4e62dc31dfde88884534385>

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20090306/2e3d017d/attachment-0001.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux