I am trying to boost the volume of the SimpleExoPlayer using the LoudnessEnhancer AudioEffect:
I get the JAUDIO_Event and the AudioSessionID, I dont get any error on creation of the AudioEffect instance and setting the gain level, but it does nothing, no effect at all, with all the values I tried for the gain level (it is in mB, 100mB=1dB).
What is the problem, why it does not work?
B4X:
Sub JAUDIO_Event (MethodName As String, Args() As Object) As Object
Log(MethodName)
If MethodName = "onAudioSessionId" Then
AudioSessionID = Args(0)
Log("AudioSessionID: " & AudioSessionID)
Dim level As Int = 20
Dim job As JavaObject
Dim jLoudness As JavaObject = job.InitializeNewInstance("android.media.audiofx.LoudnessEnhancer", Array(AudioSessionID))
jLoudness.RunMethod("setTargetGain", Array(level*100))
Log("Loudness level: " & jLoudness.RunMethod("getTargetGain", Null))
End If
Return Null
End Sub
I get the JAUDIO_Event and the AudioSessionID, I dont get any error on creation of the AudioEffect instance and setting the gain level, but it does nothing, no effect at all, with all the values I tried for the gain level (it is in mB, 100mB=1dB).
What is the problem, why it does not work?