0

Passing PCM data (from Midi) to OpenSL-ES I am searching a way to amplify the PCM signal. In OpenSL-ES I see interfaces for Bass boosting and Equalization but not one for amplification (gain above max Volume).

Is there a straight way for this?. Another possibility to test could be using the Equalizer with the same gain in all the bands (not sure of the result) but maybe there's some more direct way.

tru7
  • 6,348
  • 5
  • 35
  • 59

1 Answers1

0

You can amplify a PCM "signal" by multiplying the values of the PCM array. You should be aware however that the resulting values should not be over, or below the possible range of values (-32768 to 32767 for 16 bit PCM), otherwise there will be distortion in the output.

So if your PCM data amplitude is near the maximum and minimum range, you cannot amplify the audio using this method. Try instead the LoudnessEnhancer audio effect in Android (assuming you are asking Android related question)

Watch out when multiplying the values - if your PCM array consist of 32 bit integers, and the PCM format is 16 bit, you should split the 32 bit value in two parts, multiply each of them, and concatenate them again.

Shumoapp
  • 1,489
  • 16
  • 15