# 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)

*** ** * ** ***


```
class SoundEffectPoolComponentTester
```

<br />

*** ** * ** ***

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

## Summary

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/SoundEffectPoolComponentTester#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `@https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/SoundEffectPoolComponentTester#getPriority(androidx.xr.scenecore.Stream)(stream: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Stream)` Retrieves the playback priority of the specified `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/SoundEffectPoolComponentTester#getPriority(androidx.xr.scenecore.Stream)`. |
| `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/SoundEffect` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/SoundEffectPoolComponentTester#getSoundEffect(androidx.xr.scenecore.Stream)(stream: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Stream)` Retrieves the `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/SoundEffect` associated with the specified `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/SoundEffectPoolComponentTester#getSoundEffect(androidx.xr.scenecore.Stream)`. |
| `@https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/SoundEffectPoolComponentTester#getVolume(androidx.xr.scenecore.Stream)(stream: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Stream)` Retrieves the current volume of the specified `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/SoundEffectPoolComponentTester#getVolume(androidx.xr.scenecore.Stream)`. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/SoundEffectPoolComponentTester#hashCode()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/SoundEffectPoolComponentTester#isLooping(androidx.xr.scenecore.Stream)(stream: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Stream)` Returns whether the specified `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/SoundEffectPoolComponentTester#isLooping(androidx.xr.scenecore.Stream)` is configured to loop indefinitely. |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Stream?` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/SoundEffectPoolComponentTester#lastPausedStream()` The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Stream` of the most recently paused sound, or null if no stream has been paused yet. |
| `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/PointSourceParams?` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/SoundEffectPoolComponentTester#lastPlayedPointSourceParams()` Retrieves the `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/PointSourceParams` used in the most recent call to `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/SoundEffectPoolComponent#play(androidx.xr.scenecore.SoundEffect,kotlin.Float,kotlin.Int,kotlin.Boolean)`, or null if play has not been called yet. |
| `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Stream?` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/SoundEffectPoolComponentTester#lastPlayedStream()` The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Stream` of the most recently played sound, or null if no stream has been played yet. |
| `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Stream?` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/SoundEffectPoolComponentTester#lastResumedStream()` The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Stream` of the most recently resumed sound, or null if no stream has been resumed yet. |
| `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Stream?` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/SoundEffectPoolComponentTester#lastStoppedStream()` The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Stream` of the most recently stopped sound, or null if no stream has been stopped yet. |

## Public functions

### equals

```
open operator fun equals(other: Any?): Boolean
```

### getPriority

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

```
fun getPriority(stream: Stream): @IntRange(from = 0) Int
```

Retrieves the playback priority of the specified `https://developer.android.com/reference/kotlin/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 |
|---|---|
| `stream: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Stream` | a `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Stream` returned by `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/SoundEffectPoolComponent#play(androidx.xr.scenecore.SoundEffect,kotlin.Float,kotlin.Int,kotlin.Boolean)` |

| Returns |
|---|---|
| `@https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | 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)

```
fun getSoundEffect(stream: Stream): SoundEffect
```

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

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

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/SoundEffect` | the `https://developer.android.com/reference/kotlin/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)

```
fun getVolume(stream: Stream): @FloatRange(from = 0.0, to = 1.0) Float
```

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

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

| Returns |
|---|---|
| `@https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | 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

```
open fun hashCode(): Int
```

### isLooping

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

```
fun isLooping(stream: Stream): Boolean
```

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

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

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | 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 |

## Public properties

### lastPausedStream

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

```
val lastPausedStream: Stream?
```

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

### lastPlayedPointSourceParams

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

```
val lastPlayedPointSourceParams: PointSourceParams?
```

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

### lastPlayedStream

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

```
val lastPlayedStream: Stream?
```

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

### lastResumedStream

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

```
val lastResumedStream: Stream?
```

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

### lastStoppedStream

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

```
val lastStoppedStream: Stream?
```

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