Reputation: 230
I am trying to apply reverb effect to mediaplayer by creating a reverb on the output mix (audio session "0" ) , and I use this code
public void reverb1(View v){
PresetReverb mReverb = new PresetReverb(0,0);//<<<<<<<<<<<<<
mReverb.setPreset(PresetReverb.PRESET_LARGEROOM);
mReverb.setEnabled(true);
mp1.attachAuxEffect(mReverb.getId());
mp1.setAuxEffectSendLevel(1.0f);
}
However when I start the song and apply the effect nothing happens, song continues and reverb effect is not applied. I also added this premission in manifest <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
Still same results, am i doing something wrong?
I also tried PresetReverb mReverb = new PresetReverb(0,
mp1.getAudioSessionId());
But still same results.
any help will be appreciated
Upvotes: 2
Views: 2225
Reputation: 773
PresetReverb mReverb = new PresetReverb(0, mp1.getAudioSessionId());
This constructor takes two arguments, first is priority and another one is the audio session id. If u want to reverb than keep ur priority 1 and use global audiosessionId.
PresetReverb mReverb = new PresetReverb(1, 0);
mReverb.setPreset(PresetReverb.PRESET_LARGEROOM);
mReverb.setEnabled(true);
mp1.attachAuxEffect(mReverb.getId());
mp1.setAuxEffectSendLevel(1.0f);
one more thing to note is that this reverb effects are not supported in some of the devices ...becaz they are having limited equalizer bands. I don't have perfect resources to confirm my state about some devices , but i tested the same on some devices & it's working fine for some and not working fine for some
Upvotes: 1