# ChunkExtractor.TrackOutputProvider

# ChunkExtractor.TrackOutputProvider

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/source/chunk/ChunkExtractor.java+class:androidx.media3.exoplayer.source.chunk.ChunkExtractor.TrackOutputProvider)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/ChunkExtractor.TrackOutputProvider "View this page in Java")

<br />

```
interface ChunkExtractor.TrackOutputProvider
```

<br />

Known direct subclasses  
[BaseMediaChunkOutput](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/BaseMediaChunkOutput)  

|------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [BaseMediaChunkOutput](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/BaseMediaChunkOutput) | A[TrackOutputProvider](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkExtractor.TrackOutputProvider)that provides[TrackOutputs](https://developer.android.com/reference/kotlin/androidx/media3/extractor/TrackOutput)based on a predefined mapping from track type to output. |

*** ** * ** ***

Provides[TrackOutput](https://developer.android.com/reference/kotlin/androidx/media3/extractor/TrackOutput)instances to be written to during extraction.

## Summary

|                                          ### Public functions                                          |
|--------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [TrackOutput](https://developer.android.com/reference/kotlin/androidx/media3/extractor/TrackOutput)`!` | [track](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkExtractor.TrackOutputProvider#track(int,int))`(id: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, @`[C.TrackType](https://developer.android.com/reference/kotlin/androidx/media3/common/C.TrackType)` type: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Called to get the[TrackOutput](https://developer.android.com/reference/kotlin/androidx/media3/extractor/TrackOutput)for a specific track. |

## Public functions

### track

```
fun track(id: Int, @C.TrackType type: Int): TrackOutput!
```

Called to get the[TrackOutput](https://developer.android.com/reference/kotlin/androidx/media3/extractor/TrackOutput)for a specific track.

The same[TrackOutput](https://developer.android.com/reference/kotlin/androidx/media3/extractor/TrackOutput)is returned if multiple calls are made with the same`
id`.  

|                                                                                       Parameters                                                                                        |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------|
| `id: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                                                       | A track identifier.                                                                                       |
| `@`[C.TrackType](https://developer.android.com/reference/kotlin/androidx/media3/common/C.TrackType)` type: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The[type](https://developer.android.com/reference/kotlin/androidx/media3/common/C.TrackType)of the track. |

|                                                Returns                                                 |
|--------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|
| [TrackOutput](https://developer.android.com/reference/kotlin/androidx/media3/extractor/TrackOutput)`!` | The[TrackOutput](https://developer.android.com/reference/kotlin/androidx/media3/extractor/TrackOutput)for the given track identifier. |