# Mp3InfoReplayGain.GainField

Artifact: [androidx.media3:media3-extractor](https://developer.android.com/jetpack/androidx/releases/media3)  
[View Source](https://cs.android.com/search?q=file:androidx/media3/extractor/mp3/Mp3InfoReplayGain.java+class:androidx.media3.extractor.mp3.Mp3InfoReplayGain.GainField)

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/androidx/media3/extractor/mp3/Mp3InfoReplayGain.GainField "View this page in Java")


```
class Mp3InfoReplayGain.GainField
```

<br />

*** ** * ** ***

A gain field can store one gain adjustment with name and originator metadata.

## Summary

| ### Nested types |
|---|
| `@`[Documented](https://developer.android.com/reference/java/lang/annotation/Documented.html) `@`[Retention](https://developer.android.com/reference/java/lang/annotation/Retention.html)`(value = `[RetentionPolicy.SOURCE](https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#SOURCE)`)` `@`[Target](https://developer.android.com/reference/java/lang/annotation/Target.html)`(value = `[ElementType.TYPE_USE](https://developer.android.com/reference/java/lang/annotation/ElementType.html#TYPE_USE)`)` `@`[IntDef](https://developer.android.com/reference/kotlin/androidx/annotation/IntDef)`(value = , open = true)` `annotation `[Mp3InfoReplayGain.GainField.Name](https://developer.android.com/reference/kotlin/androidx/media3/extractor/mp3/Mp3InfoReplayGain.GainField.Name) The name of a gain field. |
| `@`[Documented](https://developer.android.com/reference/java/lang/annotation/Documented.html) `@`[Retention](https://developer.android.com/reference/java/lang/annotation/Retention.html)`(value = `[RetentionPolicy.SOURCE](https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#SOURCE)`)` `@`[Target](https://developer.android.com/reference/java/lang/annotation/Target.html)`(value = `[ElementType.TYPE_USE](https://developer.android.com/reference/java/lang/annotation/ElementType.html#TYPE_USE)`)` `@`[IntDef](https://developer.android.com/reference/kotlin/androidx/annotation/IntDef)`(value = , open = true)` `annotation `[Mp3InfoReplayGain.GainField.Originator](https://developer.android.com/reference/kotlin/androidx/media3/extractor/mp3/Mp3InfoReplayGain.GainField.Originator) The originator of a gain field. |

| ### Constants |
|---|---|
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [NAME_AUDIOPHILE](https://developer.android.com/reference/kotlin/androidx/media3/extractor/mp3/Mp3InfoReplayGain.GainField#NAME_AUDIOPHILE())` = 2` A gain adjustment that represents the ideal listening gain for each track. |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [NAME_RADIO](https://developer.android.com/reference/kotlin/androidx/media3/extractor/mp3/Mp3InfoReplayGain.GainField#NAME_RADIO())` = 1` A gain adjustment that makes all the tracks sound equally loud. |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [ORIGINATOR_ARTIST](https://developer.android.com/reference/kotlin/androidx/media3/extractor/mp3/Mp3InfoReplayGain.GainField#ORIGINATOR_ARTIST())` = 1` This gain adjustment was manually determined by the artist. |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [ORIGINATOR_REPLAYGAIN](https://developer.android.com/reference/kotlin/androidx/media3/extractor/mp3/Mp3InfoReplayGain.GainField#ORIGINATOR_REPLAYGAIN())` = 3` This gain adjustment was automatically determined by the ReplayGain algorithm. |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [ORIGINATOR_SIMPLE_RMS](https://developer.android.com/reference/kotlin/androidx/media3/extractor/mp3/Mp3InfoReplayGain.GainField#ORIGINATOR_SIMPLE_RMS())` = 4` This gain adjustment was automatically determined by a simple RMS algorithm. |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [ORIGINATOR_UNSET](https://developer.android.com/reference/kotlin/androidx/media3/extractor/mp3/Mp3InfoReplayGain.GainField#ORIGINATOR_UNSET())` = 0` The origin of this gain adjustment is not set. |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [ORIGINATOR_USER](https://developer.android.com/reference/kotlin/androidx/media3/extractor/mp3/Mp3InfoReplayGain.GainField#ORIGINATOR_USER())` = 2` This gain adjustment was manually determined by the user. |

| ### Public functions |
|---|---|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [equals](https://developer.android.com/reference/kotlin/androidx/media3/extractor/mp3/Mp3InfoReplayGain.GainField#equals(java.lang.Object))`(o: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?)` |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [hashCode](https://developer.android.com/reference/kotlin/androidx/media3/extractor/mp3/Mp3InfoReplayGain.GainField#hashCode())`()` |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | [toString](https://developer.android.com/reference/kotlin/androidx/media3/extractor/mp3/Mp3InfoReplayGain.GainField#toString())`()` |

| ### Public properties |
|---|---|
| [Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | [gain](https://developer.android.com/reference/kotlin/androidx/media3/extractor/mp3/Mp3InfoReplayGain.GainField#gain()) Absolute gain adjustment in decibels. |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | `@`[Mp3InfoReplayGain.GainField.Name](https://developer.android.com/reference/kotlin/androidx/media3/extractor/mp3/Mp3InfoReplayGain.GainField.Name) [name](https://developer.android.com/reference/kotlin/androidx/media3/extractor/mp3/Mp3InfoReplayGain.GainField#name()) Name/type of the gain field. |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | `@`[Mp3InfoReplayGain.GainField.Originator](https://developer.android.com/reference/kotlin/androidx/media3/extractor/mp3/Mp3InfoReplayGain.GainField.Originator) [originator](https://developer.android.com/reference/kotlin/androidx/media3/extractor/mp3/Mp3InfoReplayGain.GainField#originator()) Originator of the gain field, i.e. who determined the value / in what way it was determined. |

## Constants

### NAME_AUDIOPHILE

```
const val NAME_AUDIOPHILE = 2: Int
```

A gain adjustment that represents the ideal listening gain for each track.

The problem with [NAME_RADIO](https://developer.android.com/reference/kotlin/androidx/media3/extractor/mp3/Mp3InfoReplayGain.GainField#NAME_RADIO()) is that tracks which should be quiet will be brought up to the level of all the rest.

To solve this problem, the "Audiophile" setting represents the ideal listening gain for each track. ReplayGain can have a good guess at this too, by reading the entire CD, and calculating a single gain adjustment for the whole disc. This works because quiet tracks then stay quieter than the rest, since the gain won't be changed for each track. It still solves the basic problem (annoying, unwanted level differences between discs) because quiet or loud discs are still adjusted overall.

Where ReplayGain will fail is if you have an entire CD of quiet music. It will bring it up to an average level. This is why the "Audiophile" Replay Gain adjustment must be user adjustable. The ReplayGain whole disc value represents a good guess, and should be stored in the file. Later, the user can tweak it if required. If the file has originated from the artist, then the "Audiophile" setting can be specified by the artist. Naturally, the user is free to change the value if they desire.  

### NAME_RADIO

```
const val NAME_RADIO = 1: Int
```

A gain adjustment that makes all the tracks sound equally loud.

This behaves like tracks do on the radio, hence the name. If the ReplayGain is calculated on a track-by-track basis (i.e. an individual ReplayGain calculation is carried out for each track), this will be the result.  

### ORIGINATOR_ARTIST

```
const val ORIGINATOR_ARTIST = 1: Int
```

This gain adjustment was manually determined by the artist.  

### ORIGINATOR_REPLAYGAIN

```
const val ORIGINATOR_REPLAYGAIN = 3: Int
```

This gain adjustment was automatically determined by the ReplayGain algorithm.  

### ORIGINATOR_SIMPLE_RMS

```
const val ORIGINATOR_SIMPLE_RMS = 4: Int
```

This gain adjustment was automatically determined by a simple RMS algorithm.  

### ORIGINATOR_UNSET

```
const val ORIGINATOR_UNSET = 0: Int
```

The origin of this gain adjustment is not set.  

### ORIGINATOR_USER

```
const val ORIGINATOR_USER = 2: Int
```

This gain adjustment was manually determined by the user.  

## Public functions

### equals

```
fun equals(o: Any?): Boolean
```  

### hashCode

```
fun hashCode(): Int
```  

### toString

```
fun toString(): String!
```  

## Public properties

### gain

```
val gain: Float
```

Absolute gain adjustment in decibels.

Positive values mean the signal should be amplified, negative values mean it should be attenuated.

Due to limitations of the storage format, this is only accurate to the first decimal place.  

### name

```
@Mp3InfoReplayGain.GainField.Name
val name: Int
```

Name/type of the gain field.  

### originator

```
@Mp3InfoReplayGain.GainField.Originator
val originator: Int
```

Originator of the gain field, i.e. who determined the value / in what way it was determined.

Either a human (user / artist) set the value according to their preferences, or an algorithm like ReplayGain or simple RMS average was used to determine it.