# SoundEffectPoolComponentTester

Artifact: [androidx.xr.scenecore:scenecore-testing](https://developer.android.com/jetpack/androidx/releases/xr-scenecore) [View Source](https://cs.android.com/search?q=file:androidx/xr/scenecore/testing/SoundEffectPoolComponentTester.kt+class:androidx.xr.scenecore.testing.SoundEffectPoolComponentTester) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

*** ** * ** ***


```
public final class SoundEffectPoolComponentTester
```

<br />

*** ** * ** ***

A test-only accessor for `https://developer.android.com/reference/androidx/xr/scenecore/SoundEffectPoolComponent` that enables direct manipulation and inspection of its internal state.

## Summary

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SoundEffectPoolComponentTester#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final https://developer.android.com/reference/androidx/xr/scenecore/Stream` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SoundEffectPoolComponentTester#getLastPausedStream()()` The `https://developer.android.com/reference/androidx/xr/scenecore/Stream` of the most recently paused sound, or null if no stream has been paused yet. |
| `final https://developer.android.com/reference/androidx/xr/scenecore/PointSourceParams` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SoundEffectPoolComponentTester#getLastPlayedPointSourceParams()()` Retrieves the `https://developer.android.com/reference/androidx/xr/scenecore/PointSourceParams` used in the most recent call to `https://developer.android.com/reference/androidx/xr/scenecore/SoundEffectPoolComponent#play(androidx.xr.scenecore.SoundEffect,kotlin.Float,kotlin.Int,kotlin.Boolean)`, or null if play has not been called yet. |
| `final https://developer.android.com/reference/androidx/xr/scenecore/Stream` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SoundEffectPoolComponentTester#getLastPlayedStream()()` The `https://developer.android.com/reference/androidx/xr/scenecore/Stream` of the most recently played sound, or null if no stream has been played yet. |
| `final https://developer.android.com/reference/androidx/xr/scenecore/Stream` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SoundEffectPoolComponentTester#getLastResumedStream()()` The `https://developer.android.com/reference/androidx/xr/scenecore/Stream` of the most recently resumed sound, or null if no stream has been resumed yet. |
| `final https://developer.android.com/reference/androidx/xr/scenecore/Stream` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SoundEffectPoolComponentTester#getLastStoppedStream()()` The `https://developer.android.com/reference/androidx/xr/scenecore/Stream` of the most recently stopped sound, or null if no stream has been stopped yet. |
| `final @https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SoundEffectPoolComponentTester#getPriority(androidx.xr.scenecore.Stream)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Stream stream)` Retrieves the playback priority of the specified `https://developer.android.com/reference/androidx/xr/scenecore/testing/SoundEffectPoolComponentTester#getPriority(androidx.xr.scenecore.Stream)`. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/SoundEffect` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SoundEffectPoolComponentTester#getSoundEffect(androidx.xr.scenecore.Stream)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Stream stream)` Retrieves the `https://developer.android.com/reference/androidx/xr/scenecore/SoundEffect` associated with the specified `https://developer.android.com/reference/androidx/xr/scenecore/testing/SoundEffectPoolComponentTester#getSoundEffect(androidx.xr.scenecore.Stream)`. |
| `final @https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0, to = 1.0) float` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SoundEffectPoolComponentTester#getVolume(androidx.xr.scenecore.Stream)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Stream stream)` Retrieves the current volume of the specified `https://developer.android.com/reference/androidx/xr/scenecore/testing/SoundEffectPoolComponentTester#getVolume(androidx.xr.scenecore.Stream)`. |
| `int` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SoundEffectPoolComponentTester#hashCode()()` |
| `final boolean` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SoundEffectPoolComponentTester#isLooping(androidx.xr.scenecore.Stream)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Stream stream)` Returns whether the specified `https://developer.android.com/reference/androidx/xr/scenecore/testing/SoundEffectPoolComponentTester#isLooping(androidx.xr.scenecore.Stream)` is configured to loop indefinitely. |

## Public methods

### equals

```
public boolean equals(Object other)
```

### getLastPausedStream

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
public final Stream getLastPausedStream()
```

The `https://developer.android.com/reference/androidx/xr/scenecore/Stream` of the most recently paused sound, or null if no stream has been paused yet.

### getLastPlayedPointSourceParams

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
public final PointSourceParams getLastPlayedPointSourceParams()
```

Retrieves the `https://developer.android.com/reference/androidx/xr/scenecore/PointSourceParams` used in the most recent call to `https://developer.android.com/reference/androidx/xr/scenecore/SoundEffectPoolComponent#play(androidx.xr.scenecore.SoundEffect,kotlin.Float,kotlin.Int,kotlin.Boolean)`, or null if play has not been called yet.

### getLastPlayedStream

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
public final Stream getLastPlayedStream()
```

The `https://developer.android.com/reference/androidx/xr/scenecore/Stream` of the most recently played sound, or null if no stream has been played yet.

### getLastResumedStream

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
public final Stream getLastResumedStream()
```

The `https://developer.android.com/reference/androidx/xr/scenecore/Stream` of the most recently resumed sound, or null if no stream has been resumed yet.

### getLastStoppedStream

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
public final Stream getLastStoppedStream()
```

The `https://developer.android.com/reference/androidx/xr/scenecore/Stream` of the most recently stopped sound, or null if no stream has been stopped yet.

### getPriority

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
public final @IntRange(from = 0) int getPriority(@NonNull Stream stream)
```

Retrieves the playback priority of the specified `https://developer.android.com/reference/androidx/xr/scenecore/testing/SoundEffectPoolComponentTester#getPriority(androidx.xr.scenecore.Stream)`.

Priority is represented by a non-negative integer, where 0 is the lowest priority and greater values indicate higher priorities.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Stream stream` | a `https://developer.android.com/reference/androidx/xr/scenecore/Stream` returned by `https://developer.android.com/reference/androidx/xr/scenecore/SoundEffectPoolComponent#play(androidx.xr.scenecore.SoundEffect,kotlin.Float,kotlin.Int,kotlin.Boolean)` |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int` | the playback priority of the stream |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if the stream is no longer active or is invalid |

### getSoundEffect

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
public final @NonNull SoundEffect getSoundEffect(@NonNull Stream stream)
```

Retrieves the `https://developer.android.com/reference/androidx/xr/scenecore/SoundEffect` associated with the specified `https://developer.android.com/reference/androidx/xr/scenecore/testing/SoundEffectPoolComponentTester#getSoundEffect(androidx.xr.scenecore.Stream)`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Stream stream` | a `https://developer.android.com/reference/androidx/xr/scenecore/Stream` returned by `https://developer.android.com/reference/androidx/xr/scenecore/SoundEffectPoolComponent#play(androidx.xr.scenecore.SoundEffect,kotlin.Float,kotlin.Int,kotlin.Boolean)` |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/SoundEffect` | the `https://developer.android.com/reference/androidx/xr/scenecore/SoundEffect` being played on the stream |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if the stream is no longer active or is invalid |

### getVolume

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
public final @FloatRange(from = 0.0, to = 1.0) float getVolume(@NonNull Stream stream)
```

Retrieves the current volume of the specified `https://developer.android.com/reference/androidx/xr/scenecore/testing/SoundEffectPoolComponentTester#getVolume(androidx.xr.scenecore.Stream)`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Stream stream` | a `https://developer.android.com/reference/androidx/xr/scenecore/Stream` returned by `https://developer.android.com/reference/androidx/xr/scenecore/SoundEffectPoolComponent#play(androidx.xr.scenecore.SoundEffect,kotlin.Float,kotlin.Int,kotlin.Boolean)` |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0, to = 1.0) float` | the volume of the stream in the range 0.0 to 1.0 |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if the stream is no longer active or is invalid |

### hashCode

```
public int hashCode()
```

### isLooping

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
public final boolean isLooping(@NonNull Stream stream)
```

Returns whether the specified `https://developer.android.com/reference/androidx/xr/scenecore/testing/SoundEffectPoolComponentTester#isLooping(androidx.xr.scenecore.Stream)` is configured to loop indefinitely.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Stream stream` | a `https://developer.android.com/reference/androidx/xr/scenecore/Stream` returned by `https://developer.android.com/reference/androidx/xr/scenecore/SoundEffectPoolComponent#play(androidx.xr.scenecore.SoundEffect,kotlin.Float,kotlin.Int,kotlin.Boolean)` |

| Returns |
|---|---|
| `boolean` | true if the stream is looping, false otherwise |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if the stream is no longer active or is invalid |