# AudioProcessor.AudioFormat

Artifact: [androidx.media3:media3-common](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/common/audio/AudioProcessor.java+class:androidx.media3.common.audio.AudioProcessor.AudioFormat)

*** ** * ** ***


```
public final class AudioProcessor.AudioFormat
```

<br />

*** ** * ** ***

PCM audio format that may be handled by an audio processor.

## Summary

| ### Constants |
|---|---|
| `static final https://developer.android.com/reference/androidx/media3/common/audio/AudioProcessor.AudioFormat` | `https://developer.android.com/reference/androidx/media3/common/audio/AudioProcessor.AudioFormat#NOT_SET()` An `https://developer.android.com/reference/androidx/media3/common/audio/AudioProcessor.AudioFormat` instance to represent an unset `https://developer.android.com/reference/androidx/media3/common/audio/AudioProcessor.AudioFormat`. |

| ### Public fields |
|---|---|
| `final int` | `https://developer.android.com/reference/androidx/media3/common/audio/AudioProcessor.AudioFormat#bytesPerFrame()` The number of bytes used to represent one audio frame. |
| `final int` | `https://developer.android.com/reference/androidx/media3/common/audio/AudioProcessor.AudioFormat#channelCount()` The number of interleaved channels. |
| `final int` | `@https://developer.android.com/reference/androidx/media3/common/C.PcmEncoding https://developer.android.com/reference/androidx/media3/common/audio/AudioProcessor.AudioFormat#encoding()` The type of linear PCM encoding. |
| `final int` | `https://developer.android.com/reference/androidx/media3/common/audio/AudioProcessor.AudioFormat#sampleRate()` The sample rate in Hertz. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/common/audio/AudioProcessor.AudioFormat#AudioFormat(androidx.media3.common.Format)(https://developer.android.com/reference/androidx/media3/common/Format format)` Creates an instance using the `https://developer.android.com/reference/androidx/media3/common/Format#sampleRate()`, `https://developer.android.com/reference/androidx/media3/common/Format#channelCount()` and `https://developer.android.com/reference/androidx/media3/common/Format#pcmEncoding()`. |
| `https://developer.android.com/reference/androidx/media3/common/audio/AudioProcessor.AudioFormat#AudioFormat(int,int,int)(int sampleRate, int channelCount, @https://developer.android.com/reference/androidx/media3/common/C.PcmEncoding int encoding)` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/media3/common/audio/AudioProcessor.AudioFormat#equals(java.lang.Object)(@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/Object.html o)` |
| `int` | `https://developer.android.com/reference/androidx/media3/common/audio/AudioProcessor.AudioFormat#hashCode()()` |
| `https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/media3/common/audio/AudioProcessor.AudioFormat#toString()()` |

## Constants

### NOT_SET

```
public static final AudioProcessor.AudioFormat NOT_SET
```

An `https://developer.android.com/reference/androidx/media3/common/audio/AudioProcessor.AudioFormat` instance to represent an unset `https://developer.android.com/reference/androidx/media3/common/audio/AudioProcessor.AudioFormat`. This should not be returned by `https://developer.android.com/reference/androidx/media3/common/audio/AudioProcessor#configure(androidx.media3.common.audio.AudioProcessor.AudioFormat)` if the processor `https://developer.android.com/reference/androidx/media3/common/audio/AudioProcessor#isActive()`.

Typically used to represent an inactive `https://developer.android.com/reference/androidx/media3/common/audio/AudioProcessor``https://developer.android.com/reference/androidx/media3/common/audio/AudioProcessor#configure(androidx.media3.common.audio.AudioProcessor.AudioFormat)`.

## Public fields

### bytesPerFrame

```
public final int bytesPerFrame
```

The number of bytes used to represent one audio frame.

### channelCount

```
public final int channelCount
```

The number of interleaved channels.

### encoding

```
@C.PcmEncoding
public final int encoding
```

The type of linear PCM encoding.

Value is one of the following:

- `Format.NO_VALUE`

<br />

### sampleRate

```
public final int sampleRate
```

The sample rate in Hertz.

## Public constructors

### AudioFormat

```
public AudioFormat(Format format)
```

Creates an instance using the `https://developer.android.com/reference/androidx/media3/common/Format#sampleRate()`, `https://developer.android.com/reference/androidx/media3/common/Format#channelCount()` and `https://developer.android.com/reference/androidx/media3/common/Format#pcmEncoding()`.

### AudioFormat

```
public AudioFormat(int sampleRate, int channelCount, @C.PcmEncoding int encoding)
```

## Public methods

### equals

```
public boolean equals(@Nullable Object o)
```

### hashCode

```
public int hashCode()
```

### toString

```
public String toString()
```