0

I'm trying to implements presets on an android equalizer, to do so I'm using getNumberOfPresets():

 mEqualizer = new Equalizer(0, mMediaPlayer.getAudioSessionId());
 mEqualizer.setEnabled(true);

 short presetNumber = mEqualizer.getNumberOfPresets();

On my nexus 4 (4.2.2) I'm getting presetNumber=10 but using an other device running android 4.0.4 I get presetNumber=0. With this last value I am not able to use:

mEqualizer.usePreset(short);

How can I force the equalizer to use presets?

thx

Ayziaa
  • 13
  • 3

1 Answers1

0

All the audio effects are hardware-dependent and not guaranteed on all devices.

Because of this, you should always check if the device supports the AudioEffect.

You can query available effects using AudioEffect.queryEffects();

http://developer.android.com/reference/android/media/audiofx/AudioEffect.html#queryEffects()

Ken Wolf
  • 23,133
  • 6
  • 63
  • 84
  • Thank you for your answer. However, music players on the market can use presets with all devices so I thought that there was a way to force this use, but maybe there are not using presets but doing a manual band by band setup with mEqualizer.setBandLevel(band, short); – Ayziaa Jun 26 '13 at 16:03
  • Sure. I know a few don't use the built in `AudioEffect` classes at all but run their own effects in the native layer, so comparing against them might not always be useful :) – Ken Wolf Jun 26 '13 at 16:04