# CueEncoder

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

*** ** * ** ***

<br />

```
@UnstableApi
class CueEncoder
```

<br />

*** ** * ** ***

Encodes data that can be decoded by `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/CueDecoder`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/CueEncoder#CueEncoder()()` |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte/index.html>!` | `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/CueEncoder#encode(java.util.List<androidx.media3.common.text.Cue>,long)(cues: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/media3/common/text/Cue!>!, durationUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Encodes a `https://developer.android.com/reference/kotlin/androidx/media3/common/text/Cue` list and duration to a byte array that can be decoded by `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/CueDecoder#decode(long,byte[],int,int)`. |

## Public constructors

### CueEncoder

```
CueEncoder()
```

## Public functions

### encode

```
fun encode(cues: (Mutable)List<Cue!>!, durationUs: Long): Array<Byte>!
```

Encodes a `https://developer.android.com/reference/kotlin/androidx/media3/common/text/Cue` list and duration to a byte array that can be decoded by `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/CueDecoder#decode(long,byte[],int,int)`.

| Parameters |
|---|---|
| `cues: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/media3/common/text/Cue!>!` | Cues to be encoded. |
| `durationUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | Duration to be encoded, in microseconds. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte/index.html>!` | The serialized byte array. |