Ignore:
Timestamp:
Dec 26, 2006 2:27:14 AM (14 years ago)
Author:
bennylp
Message:

Ticket #51: Added audio level adjustment to PJSUA-API

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/conference.c

    r838 r864  
    6262#define SIGNATURE           PJMEDIA_PORT_SIGNATURE('C', 'O', 'N', 'F') 
    6363#define SIGNATURE_PORT      PJMEDIA_PORT_SIGNATURE('C', 'O', 'N', 'P') 
     64/* Normal level is hardcodec to 128 in all over places */ 
    6465#define NORMAL_LEVEL        128 
    6566#define SLOT_TYPE           unsigned 
     
    11381139 
    11391140    /* Value must be from -128 to +127 */ 
    1140     PJ_ASSERT_RETURN(adj_level >= -128 && adj_level <= 127, PJ_EINVAL); 
     1141    /* Disabled, you can put more than +127, at your own risk:  
     1142     PJ_ASSERT_RETURN(adj_level >= -128 && adj_level <= 127, PJ_EINVAL); 
     1143     */ 
     1144    PJ_ASSERT_RETURN(adj_level >= -128, PJ_EINVAL); 
    11411145 
    11421146    conf_port = conf->ports[slot]; 
     
    11651169 
    11661170    /* Value must be from -128 to +127 */ 
    1167     PJ_ASSERT_RETURN(adj_level >= -128 && adj_level <= 127, PJ_EINVAL); 
     1171    /* Disabled, you can put more than +127,, at your own risk: 
     1172     PJ_ASSERT_RETURN(adj_level >= -128 && adj_level <= 127, PJ_EINVAL); 
     1173     */ 
     1174    PJ_ASSERT_RETURN(adj_level >= -128, PJ_EINVAL); 
    11681175 
    11691176    conf_port = conf->ports[slot]; 
     
    13651372                 */ 
    13661373                itemp = input[j]; 
    1367                 itemp = itemp * adj / NORMAL_LEVEL; 
     1374                /*itemp = itemp * adj / NORMAL_LEVEL; */ 
     1375                itemp = (itemp * adj) >> 7; 
    13681376 
    13691377                /* Clip the signal if it's too loud */ 
     
    13971405 
    13981406            /* Adjust the level */ 
    1399             itemp = itemp * adj_level / NORMAL_LEVEL; 
     1407            /*itemp = itemp * adj_level / NORMAL_LEVEL;*/ 
     1408            itemp = (itemp * adj_level) >> 7; 
    14001409 
    14011410            /* Clip the signal if it's too loud */ 
     
    16511660                 */ 
    16521661                itemp = input[j]; 
    1653                 itemp = itemp * adj / NORMAL_LEVEL; 
     1662                /*itemp = itemp * adj / NORMAL_LEVEL;*/ 
     1663                itemp = (itemp * adj) >> 7; 
    16541664 
    16551665                /* Clip the signal if it's too loud */ 
Note: See TracChangeset for help on using the changeset viewer.