# SpeedChangeEffect

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

*** ** * ** ***


```
@UnstableApi
class SpeedChangeEffect : GlEffect
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
>
> Use `EditedMediaItem.Builder#setSpeed(SpeedProvider)` instead.

## Summary

| ### Public constructors |
|---|
| `[SpeedChangeEffect](https://developer.android.com/reference/kotlin/androidx/media3/effect/SpeedChangeEffect#SpeedChangeEffect(float))(speed: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0, fromInclusive = false) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` **This function is deprecated.** Deprecated in Java |
| `[SpeedChangeEffect](https://developer.android.com/reference/kotlin/androidx/media3/effect/SpeedChangeEffect#SpeedChangeEffect(androidx.media3.common.audio.SpeedProvider))(speedProvider: https://developer.android.com/reference/kotlin/androidx/media3/common/audio/SpeedProvider!)` **This function is deprecated.** Deprecated in Java |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `[getDurationAfterEffectApplied](https://developer.android.com/reference/kotlin/androidx/media3/effect/SpeedChangeEffect#getDurationAfterEffectApplied(long))(durationUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` **This function is deprecated.** Deprecated in Java |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `[isNoOp](https://developer.android.com/reference/kotlin/androidx/media3/effect/SpeedChangeEffect#isNoOp(int,int))(inputWidth: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, inputHeight: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/media3/effect/GlShaderProgram!` | `[toGlShaderProgram](https://developer.android.com/reference/kotlin/androidx/media3/effect/SpeedChangeEffect#toGlShaderProgram(android.content.Context,boolean))(context: https://developer.android.com/reference/android/content/Context.html!, useHdr: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` **This function is deprecated.** Deprecated in Java |

## Public constructors

### SpeedChangeEffect

```
[SpeedChangeEffect](https://developer.android.com/reference/kotlin/androidx/media3/effect/SpeedChangeEffect#SpeedChangeEffect(float))(speed: @FloatRange(from = 0, fromInclusive = false) Float)
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Creates an instance that applies the same `speed` change to all the timestamps.

### SpeedChangeEffect

```
[SpeedChangeEffect](https://developer.android.com/reference/kotlin/androidx/media3/effect/SpeedChangeEffect#SpeedChangeEffect(androidx.media3.common.audio.SpeedProvider))(speedProvider: SpeedProvider!)
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Creates an instance.

| Parameters |
|---|---|
| `speedProvider: https://developer.android.com/reference/kotlin/androidx/media3/common/audio/SpeedProvider!` | The `https://developer.android.com/reference/kotlin/androidx/media3/common/audio/SpeedProvider` specifying the speed changes. Applied on each stream assuming the first frame timestamp of the input media is 0. |

## Public functions

### getDurationAfterEffectApplied

```
fun [getDurationAfterEffectApplied](https://developer.android.com/reference/kotlin/androidx/media3/effect/SpeedChangeEffect#getDurationAfterEffectApplied(long))(durationUs: Long): Long
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Returns the expected duration of the output stream when the effect is applied given a input `durationUs`.

### isNoOp

```
fun [isNoOp](https://developer.android.com/reference/kotlin/androidx/media3/effect/SpeedChangeEffect#isNoOp(int,int))(inputWidth: Int, inputHeight: Int): Boolean
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Returns whether a `https://developer.android.com/reference/kotlin/androidx/media3/effect/GlEffect` applies no change at every timestamp.

This can be used as a hint to skip this instance.

| Parameters |
|---|---|
| `inputWidth: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The input frame width, in pixels. |
| `inputHeight: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The input frame height, in pixels. |

### toGlShaderProgram

```
fun [toGlShaderProgram](https://developer.android.com/reference/kotlin/androidx/media3/effect/SpeedChangeEffect#toGlShaderProgram(android.content.Context,boolean))(context: Context!, useHdr: Boolean): GlShaderProgram!
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Returns a `https://developer.android.com/reference/kotlin/androidx/media3/effect/GlShaderProgram` that applies the effect.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html!` | A `https://developer.android.com/reference/android/content/Context.html`. |
| `useHdr: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether input textures come from an HDR source. If `true`, colors will be in linear RGB BT.2020. If `false`, colors will be in linear RGB BT.709. |

| Throws |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/VideoFrameProcessingException` | If an error occurs while creating the `https://developer.android.com/reference/kotlin/androidx/media3/effect/GlShaderProgram`. |