mirror of
https://github.com/yuliskov/SmartTube.git
synced 2026-05-21 14:58:39 -05:00
Merge branch 'ManuLinares-master'
This commit is contained in:
+4
-9
@@ -50,15 +50,10 @@ public class VolumeBooster implements AudioListener {
|
||||
try {
|
||||
mBooster = new LoudnessEnhancer(audioSessionId);
|
||||
mBooster.setEnabled(mIsEnabled);
|
||||
|
||||
//double log2 = Math.log(mVolume) / Math.log(2);
|
||||
//double gainMb = 10 * log2 * 100;
|
||||
//mBooster.setTargetGain((int) gainMb);
|
||||
|
||||
double gainMb = 20 * Math.log10(mVolume * 3) * 100;
|
||||
mBooster.setTargetGain((int) gainMb);
|
||||
|
||||
//mBooster.setTargetGain((int) (1000 * mVolume));
|
||||
|
||||
// Convert linear volume multiplier to millibels (100mB = 1dB)
|
||||
double gainMillibels = 20 * Math.log10(mVolume) * 100;
|
||||
mBooster.setTargetGain((int) Math.round(gainMillibels));
|
||||
|
||||
mIsSupported = true;
|
||||
} catch (RuntimeException | UnsatisfiedLinkError | NoClassDefFoundError | NoSuchFieldError e) { // Cannot initialize effect engine
|
||||
|
||||
Reference in New Issue
Block a user