# 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
public final class SpeedChangeEffect implements GlEffect
```

<br />

*** ** * ** ***

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

## Summary

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

| ### Public methods |
|---|---|
| `long` | `[getDurationAfterEffectApplied](https://developer.android.com/reference/androidx/media3/effect/SpeedChangeEffect#getDurationAfterEffectApplied(long))(long durationUs)` **This method is deprecated.** Deprecated in Java |
| `boolean` | `[isNoOp](https://developer.android.com/reference/androidx/media3/effect/SpeedChangeEffect#isNoOp(int,int))(int inputWidth, int inputHeight)` **This method is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/androidx/media3/effect/GlShaderProgram` | `[toGlShaderProgram](https://developer.android.com/reference/androidx/media3/effect/SpeedChangeEffect#toGlShaderProgram(android.content.Context,boolean))(https://developer.android.com/reference/android/content/Context.html context, boolean useHdr)` **This method is deprecated.** Deprecated in Java |

## Public constructors

### SpeedChangeEffect

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

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

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

### SpeedChangeEffect

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

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

Creates an instance.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/audio/SpeedProvider speedProvider` | The `https://developer.android.com/reference/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 methods

### getDurationAfterEffectApplied

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

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

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

### isNoOp

```
public boolean [isNoOp](https://developer.android.com/reference/androidx/media3/effect/SpeedChangeEffect#isNoOp(int,int))(int inputWidth, int inputHeight)
```

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

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

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

| Parameters |
|---|---|
| `int inputWidth` | The input frame width, in pixels. |
| `int inputHeight` | The input frame height, in pixels. |

### toGlShaderProgram

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

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

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

| Parameters |
|---|---|
| `https://developer.android.com/reference/android/content/Context.html context` | A `https://developer.android.com/reference/android/content/Context.html`. |
| `boolean useHdr` | 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/androidx/media3/common/VideoFrameProcessingException` | If an error occurs while creating the `https://developer.android.com/reference/androidx/media3/effect/GlShaderProgram`. |