[asterisk-dev] volume boosting ?

Luigi Rizzo rizzo at icir.org
Thu Jan 26 10:27:54 MST 2006


I recently added a 'boost' feature to chan_oss
to overcome the problem of low volume levels from
some PC soundcards. The core is below and the feature
is fairly simple, but i was wondering if there isn't
already a library routine that implements this ?

cheers
luigi

+       if (o->boost != BOOST_SCALE) { /* scale and clip values */
+               int i, x;
+               int16_t *p = (int16_t *)f->data;
+               for (i = 0; i < f->samples; i++) {
+                       x = (p[i] * o->boost) / BOOST_SCALE;
+                       if (x > 32767)
+                               x = 32767;
+                       else if (x < -32768)
+                               x = -32768;
+                       p[i] = x;
+               }
+       }





More information about the asterisk-dev mailing list