EqualizerBand
class EqualizerBand : Parcelable
| kotlin.Any | |
| ↳ | android.media.quality.EqualizerBand |
Represents a single band in an equalizer.
An equalizer is composed of multiple bands, each targeting a specific frequency range in the audio spectrum. This parcelable defines the properties of one such band.
Summary
| Inherited constants | |
|---|---|
| Public constructors | |
|---|---|
EqualizerBand(frequencyHz: Int, gainDb: Int, qFactor: Float)Constructs an EqualizerBand. |
|
| Public methods | |
|---|---|
| Int |
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| Int |
Gets the center frequency of the band in Hertz. |
| Int |
Gets the gain for the band in decibels (dB). |
| Float |
Gets the Quality Factor (Q). |
| Unit |
writeToParcel(dest: Parcel, flags: Int)Flatten this object in to a Parcel. |
| Properties | |
|---|---|
| static Parcelable.Creator<EqualizerBand!> | |
Public constructors
EqualizerBand
EqualizerBand(
frequencyHz: Int,
gainDb: Int,
qFactor: Float)
Constructs an EqualizerBand.
| Parameters | |
|---|---|
frequencyHz |
Int: The center frequency of this band in Hertz (Hz). Value is 1 or greater |
gainDb |
Int: The gain (level) for this band in decibels (dB). |
qFactor |
Float: The Quality Factor (Q). Value is 0.0f or greater |
| Exceptions | |
|---|---|
java.lang.IllegalArgumentException |
if any parameter is out of its supported range. |
Public methods
describeContents
fun describeContents(): Int
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(Parcel,int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.
| Return | |
|---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or
|
getFrequencyHz
fun getFrequencyHz(): Int
Gets the center frequency of the band in Hertz.
| Return | |
|---|---|
Int |
Value is 1 or greater |
getGainDb
fun getGainDb(): Int
Gets the gain for the band in decibels (dB). The range is determined by hardware capabilities. (e.g., -50 to 50 or -100 to 100)
Negative means the signal in this frequency band is reduced, so the output is quieter than the input. (This is used to remove unwanted frequencies like "mud" or "hiss")
Positive means the signal in this frequency band is amplified, so the output is louder than the input.
0 means the signal is unchanged and this is the default state of an equalizer.
getQFactor
fun getQFactor(): Float
Gets the Quality Factor (Q).
The Q factor controls the bandwidth (width) of the frequency range affected by this filter It is inversely proportional to bandwidth:
- High Q (e.g., > 2.0): Creates a narrow, sharp curve. Used for precise adjustments (e.g., removing a specific resonant frequency).
- Low Q (e.g., < 0.7): Creates a wide, broad curve. Used for general tonal shaping (e.g., "boosting the bass").
| Return | |
|---|---|
Float |
Value is 0.0f or greater |
writeToParcel
fun writeToParcel(
dest: Parcel,
flags: Int
): Unit
Flatten this object in to a Parcel.
| Parameters | |
|---|---|
dest |
Parcel: This value cannot be null. |
flags |
Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of the following:
|