# SoundEffectPoolTester

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/SoundEffectPoolTester.kt+class:androidx.xr.scenecore.testing.SoundEffectPoolTester) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

*** ** * ** ***


```
public final class SoundEffectPoolTester
```

<br />

*** ** * ** ***

A data container for inspecting the properties of a `https://developer.android.com/reference/androidx/xr/scenecore/SoundEffectPool` resource.

## Summary

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SoundEffectPoolTester#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `int` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SoundEffectPoolTester#hashCode()()` |
| `final boolean` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SoundEffectPoolTester#isAssetLoaded(android.content.res.AssetFileDescriptor)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/res/AssetFileDescriptor.html assetFileDescriptor)` Checks if a sound effect with the given `https://developer.android.com/reference/android/content/res/AssetFileDescriptor.html` is currently loaded in the pool. |
| `final boolean` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SoundEffectPoolTester#isResourceLoaded(kotlin.Int)(int resourceId)` Checks if a sound effect with the given resource ID is currently loaded in the pool. |
| `final void` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SoundEffectPoolTester#triggerLoadCompleteListener(androidx.xr.scenecore.SoundEffect,kotlin.Boolean)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/SoundEffect soundEffect, boolean success )` Simulates a load complete event from the runtime, notifying all registered listeners. |

## Public methods

### equals

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

### hashCode

```
public int hashCode()
```

### isAssetLoaded

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

```
public final boolean isAssetLoaded(@NonNull AssetFileDescriptor assetFileDescriptor)
```

Checks if a sound effect with the given `https://developer.android.com/reference/android/content/res/AssetFileDescriptor.html` is currently loaded in the pool.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/res/AssetFileDescriptor.html assetFileDescriptor` | The file descriptor to check. |

| Returns |
|---|---|
| `boolean` | `true` if the descriptor is currently loaded, `false` otherwise. |

### isResourceLoaded

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

```
public final boolean isResourceLoaded(int resourceId)
```

Checks if a sound effect with the given resource ID is currently loaded in the pool.

| Parameters |
|---|---|
| `int resourceId` | The resource ID to check. |

| Returns |
|---|---|
| `boolean` | `true` if the resource is currently loaded, `false` otherwise. |

### triggerLoadCompleteListener

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

```
public final void triggerLoadCompleteListener(
    @NonNull SoundEffect soundEffect,
    boolean success
)
```

Simulates a load complete event from the runtime, notifying all registered listeners.

This triggers `https://developer.android.com/reference/androidx/xr/scenecore/SoundEffectPool.LoadCompleteListener` registered via `https://developer.android.com/reference/androidx/xr/scenecore/SoundEffectPool#addLoadCompleteListener(androidx.xr.scenecore.SoundEffectPool.LoadCompleteListener)`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/SoundEffect soundEffect` | The `https://developer.android.com/reference/androidx/xr/scenecore/SoundEffect` that was loaded. |
| `boolean success` | Whether the load was successful. |