0

Some Android devices have audio equalizer settings - for example, on Huawei (on the P9 Lite at least) you can enable the "Headset SWS Effect". I know Sony and Xaomi devices also have similar settings.

Is there any way to detect, programmatically if such effects are enabled?

HPage
  • 1,412
  • 20
  • 27

1 Answers1

0

You can achieve by this.

Equalizer equalizer = new Equalizer(0, player.getAudioSessionId());
   boolean isEnable=equalizer.getEnabled();

  if(isEnable){
    //put your code
   }

Happy coding!!

Hemant Parmar
  • 3,924
  • 7
  • 25
  • 49
  • Thanks, but unfortunately I get: `AudioFlinger could not create effect, status: -22 AudioEffect initCheck failed -3 Error code -3 when initializing AudioEffect.` I am not trying to use sessionId 0. – HPage Nov 29 '17 at 07:08
  • Seems like this is related: https://community.spotify.com/t5/Android/No-equalizer-on-my-new-huawei-p9/m-p/1427831/highlight/true#M64502 So I don't think the Huawei `Headset SWS Effect` is something that can be detected by using the Equalizer class. – HPage Nov 29 '17 at 07:12