# CodecParameters.Builder

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

*** ** * ** ***


```
class CodecParameters.Builder
```

<br />

*** ** * ** ***

A builder for `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/CodecParameters` instances.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/CodecParameters.Builder#Builder()()` Creates an empty builder. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/CodecParameters!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/CodecParameters.Builder#build()()` Builds the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/CodecParameters` instance. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/CodecParameters.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/CodecParameters.Builder#remove(java.lang.String)(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` Removes a parameter from this builder, preventing it from being applied. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/CodecParameters.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/CodecParameters.Builder#setByteBuffer(java.lang.String,java.nio.ByteBuffer)(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, value: https://developer.android.com/reference/java/nio/ByteBuffer.html?)` Sets a byte buffer parameter value. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/CodecParameters.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/CodecParameters.Builder#setFloat(java.lang.String,float)(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Sets a float parameter value. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/CodecParameters.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/CodecParameters.Builder#setInteger(java.lang.String,int)(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Sets an integer parameter value. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/CodecParameters.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/CodecParameters.Builder#setLong(java.lang.String,long)(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Sets a long parameter value. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/CodecParameters.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/CodecParameters.Builder#setString(java.lang.String,java.lang.String)(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?)` Sets a string parameter value. |

## Public constructors

### Builder

```
Builder()
```

Creates an empty builder.

## Public functions

### build

```
fun build(): CodecParameters!
```

Builds the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/CodecParameters` instance.

### remove

```
@CanIgnoreReturnValue
fun remove(key: String!): CodecParameters.Builder!
```

Removes a parameter from this builder, preventing it from being applied.

Note: This does not reset a parameter on a live codec. To do so, explicitly set the parameter to its default value.

| Parameters |
|---|---|
| `key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | The key of the parameter to remove. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/CodecParameters.Builder!` | This builder. |

### setByteBuffer

```
@CanIgnoreReturnValue
fun setByteBuffer(key: String!, value: ByteBuffer?): CodecParameters.Builder!
```

Sets a byte buffer parameter value.

| Parameters |
|---|---|
| `key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | The parameter key. |
| `value: https://developer.android.com/reference/java/nio/ByteBuffer.html?` | The `https://developer.android.com/reference/java/nio/ByteBuffer.html` value, which may be `null`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/CodecParameters.Builder!` | This builder. |

### setFloat

```
@CanIgnoreReturnValue
fun setFloat(key: String!, value: Float): CodecParameters.Builder!
```

Sets a float parameter value.

| Parameters |
|---|---|
| `key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | The parameter key. |
| `value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | The float value. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/CodecParameters.Builder!` | This builder. |

### setInteger

```
@CanIgnoreReturnValue
fun setInteger(key: String!, value: Int): CodecParameters.Builder!
```

Sets an integer parameter value.

| Parameters |
|---|---|
| `key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | The parameter key. |
| `value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The integer value. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/CodecParameters.Builder!` | This builder. |

### setLong

```
@CanIgnoreReturnValue
fun setLong(key: String!, value: Long): CodecParameters.Builder!
```

Sets a long parameter value.

| Parameters |
|---|---|
| `key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | The parameter key. |
| `value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The long value. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/CodecParameters.Builder!` | This builder. |

### setString

```
@CanIgnoreReturnValue
fun setString(key: String!, value: String?): CodecParameters.Builder!
```

Sets a string parameter value.

| Parameters |
|---|---|
| `key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | The parameter key. |
| `value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | The string value, which may be `null`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/CodecParameters.Builder!` | This builder. |