# AudioProcessor.StreamMetadata.Builder

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.StreamMetadata.Builder)

*** ** * ** ***


```
class AudioProcessor.StreamMetadata.Builder
```

<br />

*** ** * ** ***

A builder for `https://developer.android.com/reference/kotlin/androidx/media3/common/audio/AudioProcessor.StreamMetadata`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/audio/AudioProcessor.StreamMetadata.Builder#Builder()()` Creates a new builder. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/audio/AudioProcessor.StreamMetadata!` | `https://developer.android.com/reference/kotlin/androidx/media3/common/audio/AudioProcessor.StreamMetadata.Builder#build()()` Builds a `https://developer.android.com/reference/kotlin/androidx/media3/common/audio/AudioProcessor.StreamMetadata` instance. |
| `https://developer.android.com/reference/kotlin/androidx/media3/common/audio/AudioProcessor.StreamMetadata.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/common/audio/AudioProcessor.StreamMetadata.Builder#setPeriodUid(java.lang.Object)(periodUid: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` Sets the `https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline.Period#uid()` of the current playback this audio processor is used for. |
| `https://developer.android.com/reference/kotlin/androidx/media3/common/audio/AudioProcessor.StreamMetadata.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/common/audio/AudioProcessor.StreamMetadata.Builder#setPositionOffsetUs(long)(positionOffsetUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Sets the stream position in microseconds from which the processor will start receiving input buffers after a call to `https://developer.android.com/reference/kotlin/androidx/media3/common/audio/AudioProcessor#flush(androidx.media3.common.audio.AudioProcessor.StreamMetadata)`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/common/audio/AudioProcessor.StreamMetadata.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/common/audio/AudioProcessor.StreamMetadata.Builder#setTimeline(androidx.media3.common.Timeline)(timeline: https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline!)` Sets the `https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline` of the current playback this audio processor is used for. |

## Public constructors

### Builder

```
Builder()
```

Creates a new builder.

## Public functions

### build

```
fun build(): AudioProcessor.StreamMetadata!
```

Builds a `https://developer.android.com/reference/kotlin/androidx/media3/common/audio/AudioProcessor.StreamMetadata` instance.

### setPeriodUid

```
@CanIgnoreReturnValue
fun setPeriodUid(periodUid: Any?): AudioProcessor.StreamMetadata.Builder!
```

Sets the `https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline.Period#uid()` of the current playback this audio processor is used for.

If the period UID is non-null and the provided `https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline` non-empty, this UID must be present in the provided `https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline`.

| Parameters |
|---|---|
| `periodUid: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?` | The `https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline.Period#uid()` or `null` to leave it undefined. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/audio/AudioProcessor.StreamMetadata.Builder!` | This builder. |

### setPositionOffsetUs

```
@CanIgnoreReturnValue
fun setPositionOffsetUs(positionOffsetUs: Long): AudioProcessor.StreamMetadata.Builder!
```

Sets the stream position in microseconds from which the processor will start receiving input buffers after a call to `https://developer.android.com/reference/kotlin/androidx/media3/common/audio/AudioProcessor#flush(androidx.media3.common.audio.AudioProcessor.StreamMetadata)`.

The position offset is aligned to the `https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline.Window` start position.

The offset value is up-to-date at the time of the `https://developer.android.com/reference/kotlin/androidx/media3/common/audio/AudioProcessor#flush(androidx.media3.common.audio.AudioProcessor.StreamMetadata)` call, but might change due to updates to the media structure. In that case, the offset value will not be updated until the next call to `https://developer.android.com/reference/kotlin/androidx/media3/common/audio/AudioProcessor#flush(androidx.media3.common.audio.AudioProcessor.StreamMetadata)`.

| Parameters |
|---|---|
| `positionOffsetUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The stream position offset in microseconds. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/audio/AudioProcessor.StreamMetadata.Builder!` | This builder. |

### setTimeline

```
@CanIgnoreReturnValue
fun setTimeline(timeline: Timeline!): AudioProcessor.StreamMetadata.Builder!
```

Sets the `https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline` of the current playback this audio processor is used for.

| Parameters |
|---|---|
| `timeline: https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline!` | The `https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/audio/AudioProcessor.StreamMetadata.Builder!` | This builder. |