title: UnsupportedOperationException AudioEffect: invalid parameter operation
body: <p>I'm getting an <strong>UnsupportedOperationException</strong> error on an equalizer on this line of code. <code>bassBoost.setStrength((short) bassBoostPos);</code></p>
  
  <p>Here's the code</p>
  
  <pre><code>equalizer = new Equalizer(0, 0);
  if (equalizer != null) {
  equalizer.setEnabled (isEqualizer);
  numBands = equalizer.getNumberOfBands();
  short r[] = equalizer.getBandLevelRange();
  minLevel = r[0];
  maxLevel = r[1];
  bassBoost = new BassBoost (0, 0);
  
  if(bassBoost != null) {
      bassBoost.setEnabled(bassBoostPos &gt; 0 ? true : false);
      bassBoost.setStrength((short) bassBoostPos); 
  }
  </code></pre>
  
  <p>Here's the exception </p>
  
  <pre><code>java.lang.UnsupportedOperationException: AudioEffect: invalid parameter    
  operation
  at android.media.audiofx.AudioEffect.checkStatus(AudioEffect.java:1271)
  at android.media.audiofx.BassBoost.setStrength(BassBoost.java:127)
  </code></pre>
  
  <p>How do I fix this so that the application doesn't crash. I mean how can I check to see if the device support this operation, if it doesn't support, I would just skip this line. Thanks.</p>