| java.lang.Object | ||
| ↳ | android.media.audiofx.AudioEffect | |
| ↳ | android.media.audiofx.BassEnhance | |
bass enhance is an audio effect to boost or amplify low frequencies of the sound. It is comparable to a simple equalizer but limited to one band amplification in the low frequency range.
An application creates a BassEnhance object to instantiate and control a bass enhance engine in the audio framework.
The methods, parameter types and units exposed by the BassEnhance implementation are directly mapping those defined by the OpenSL ES 1.0.1 Specification (http://www.khronos.org/opensles/) for the SLBassEnhanceItf interface. Please refer to this specification for more details.
To attach the BassEnhance to a particular AudioTrack or MediaPlayer, specify the audio session ID of this AudioTrack or MediaPlayer when constructing the BassEnhance. If the audio session ID 0 is specified, the BassEnhance applies to the main audio output mix.
Creating a BassEnhance on the output mix (audio session 0) requires permission
 MODIFY_AUDIO_SETTINGS
 
See getAudioSessionId() for details on audio sessions.
 
See AudioEffect class for more details on
 controlling audio effects.
| Nested Classes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| BassEnhance.OnParameterChangeListener | The OnParameterChangeListener interface defines a method called by the BassEnhance when a parameter value has changed. | ||||||||||
| BassEnhance.Settings | The Settings class regroups all bass enhance parameters. | ||||||||||
| Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| int | PARAM_STRENGTH | bass enhance effect strength. | |||||||||
| int | PARAM_STRENGTH_SUPPORTED | Is strength parameter supported by bass enhance engine. | |||||||||
| 
  [Expand]
   Inherited Constants  | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
   From class
android.media.audiofx.AudioEffect
 | |||||||||||
| 
  [Expand]
   Inherited Fields  | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
   From class
android.media.audiofx.AudioEffect
 | |||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Class constructor. 
  
   | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Gets the bass enhance properties. 
  
   | |||||||||||
Gets the current strength of the effect. 
  
   | |||||||||||
Indicates whether setting strength is supported. 
  
   | |||||||||||
Registers an OnParameterChangeListener interface. 
  
   | |||||||||||
Sets the bass enhance properties. 
  
   | |||||||||||
Sets the strength of the bass enhance effect. 
  
   | |||||||||||
| 
  [Expand]
   Inherited Methods  | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
   
From class
  android.media.audiofx.AudioEffect
 | |||||||||||
   
From class
  java.lang.Object
 | |||||||||||
bass enhance effect strength. Parameter ID for
 BassEnhance.OnParameterChangeListener
Is strength parameter supported by bass enhance engine. Parameter ID for getParameter().
Class constructor.
| priority | the priority level requested by the application for controlling the BassEnhance engine. As the same engine can be shared by several applications, this parameter indicates how much the requesting application needs control of effect parameters. The normal priority is 0, above normal is a positive number, below normal a negative number. | 
|---|---|
| audioSession | system wide unique audio session identifier. If audioSession is not 0, the BassEnhance will be attached to the MediaPlayer or AudioTrack in the same audio session. Otherwise, the BassEnhance will apply to the output mix. | 
| java.lang.IllegalStateException | |
| java.lang.IllegalArgumentException | |
| java.lang.UnsupportedOperationException | |
| RuntimeException | |
| IllegalArgumentException | |
| IllegalStateException | |
| UnsupportedOperationException | 
Gets the bass enhance properties. This method is useful when a snapshot of current bass enhance settings must be saved by the application.
| IllegalStateException | |
| IllegalArgumentException | |
| UnsupportedOperationException | |
| IllegalArgumentException | |
| IllegalStateException | 
Gets the current strength of the effect.
| IllegalStateException | |
| IllegalArgumentException | |
| UnsupportedOperationException | |
| IllegalArgumentException | |
| IllegalStateException | 
Indicates whether setting strength is supported. If this method returns false, only one strength is supported and the setStrength() method always rounds to that value.
Registers an OnParameterChangeListener interface.
| listener | OnParameterChangeListener interface registered | 
|---|
Sets the bass enhance properties. This method is useful when bass enhance settings have to be applied from a previous backup.
| settings | a BassEnhance.Settings object containing the properties to apply | 
|---|
| IllegalStateException | |
| IllegalArgumentException | |
| UnsupportedOperationException | |
| IllegalArgumentException | |
| IllegalStateException | 
Sets the strength of the bass enhance effect. If the implementation does not support per mille
 accuracy for setting the strength, it is allowed to round the given strength to the nearest
 supported value. You can use the getRoundedStrength() method to query the
 (possibly rounded) value that was actually set.
| strength | strength of the effect. The valid range for strength strength is [0, 1000], where 0 per mille designates the mildest effect and 1000 per mille designates the strongest. | 
|---|
| IllegalStateException | |
| IllegalArgumentException | |
| UnsupportedOperationException | |
| IllegalArgumentException | |
| IllegalStateException |