# 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)

*** ** * ** ***


```
public final class AudioProcessor.StreamMetadata.Builder
```

<br />

*** ** * ** ***

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

## Summary

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

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

## Public constructors

### Builder

```
public Builder()
```

Creates a new builder.

## Public methods

### build

```
public AudioProcessor.StreamMetadata build()
```

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

### setPeriodUid

```
@CanIgnoreReturnValue
public AudioProcessor.StreamMetadata.Builder setPeriodUid(@Nullable Object periodUid)
```

Sets the `https://developer.android.com/reference/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/androidx/media3/common/Timeline` non-empty, this UID must be present in the provided `https://developer.android.com/reference/androidx/media3/common/Timeline`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/Object.html periodUid` | The `https://developer.android.com/reference/androidx/media3/common/Timeline.Period#uid()` or `null` to leave it undefined. |

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

### setPositionOffsetUs

```
@CanIgnoreReturnValue
public AudioProcessor.StreamMetadata.Builder setPositionOffsetUs(long positionOffsetUs)
```

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

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

The offset value is up-to-date at the time of the `https://developer.android.com/reference/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/androidx/media3/common/audio/AudioProcessor#flush(androidx.media3.common.audio.AudioProcessor.StreamMetadata)`.

| Parameters |
|---|---|
| `long positionOffsetUs` | The stream position offset in microseconds. |

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

### setTimeline

```
@CanIgnoreReturnValue
public AudioProcessor.StreamMetadata.Builder setTimeline(Timeline timeline)
```

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

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

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