# SpatialSoundPoolTester

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

*** ** * ** ***


```
public final class SpatialSoundPoolTester
```

<br />

*** ** * ** ***

A test utility for accessing and inspecting the spatial data associated with the `https://developer.android.com/reference/androidx/xr/scenecore/SpatialSoundPool`.

## Summary

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SpatialSoundPoolTester#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final int` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SpatialSoundPoolTester#getPlayAsPointSourceResult()()` The value that will be returned by the `https://developer.android.com/reference/androidx/xr/scenecore/SpatialSoundPool#play(androidx.xr.runtime.Session,android.media.SoundPool,kotlin.Int,androidx.xr.scenecore.PointSourceParams,androidx.xr.scenecore.Entity,kotlin.Float,kotlin.Int,kotlin.Int,kotlin.Float)` method for point source audio. |
| `final int` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SpatialSoundPoolTester#getPlayAsSoundFieldResult()()` The value that will be returned by the `https://developer.android.com/reference/androidx/xr/scenecore/SpatialSoundPool#play(androidx.xr.runtime.Session,android.media.SoundPool,kotlin.Int,androidx.xr.scenecore.PointSourceParams,androidx.xr.scenecore.Entity,kotlin.Float,kotlin.Int,kotlin.Int,kotlin.Float)` method for sound field audio. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/SpatializerConstants.SourceType` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SpatialSoundPoolTester#getSpatialSourceType()()` The spatial source type which can be retrieved from `https://developer.android.com/reference/androidx/xr/scenecore/SpatialSoundPool#getSpatialSourceType(androidx.xr.runtime.Session,android.media.SoundPool,kotlin.Int)` of the sound pool. |
| `int` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SpatialSoundPoolTester#hashCode()()` |
| `final void` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SpatialSoundPoolTester#setPlayAsPointSourceResult(kotlin.Int)(int value)` The value that will be returned by the `https://developer.android.com/reference/androidx/xr/scenecore/SpatialSoundPool#play(androidx.xr.runtime.Session,android.media.SoundPool,kotlin.Int,androidx.xr.scenecore.PointSourceParams,androidx.xr.scenecore.Entity,kotlin.Float,kotlin.Int,kotlin.Int,kotlin.Float)` method for point source audio. |
| `final void` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SpatialSoundPoolTester#setPlayAsSoundFieldResult(kotlin.Int)(int value)` The value that will be returned by the `https://developer.android.com/reference/androidx/xr/scenecore/SpatialSoundPool#play(androidx.xr.runtime.Session,android.media.SoundPool,kotlin.Int,androidx.xr.scenecore.PointSourceParams,androidx.xr.scenecore.Entity,kotlin.Float,kotlin.Int,kotlin.Int,kotlin.Float)` method for sound field audio. |
| `final void` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SpatialSoundPoolTester#setSpatialSourceType(androidx.xr.scenecore.SpatializerConstants.SourceType)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/SpatializerConstants.SourceType value)` The spatial source type which can be retrieved from `https://developer.android.com/reference/androidx/xr/scenecore/SpatialSoundPool#getSpatialSourceType(androidx.xr.runtime.Session,android.media.SoundPool,kotlin.Int)` of the sound pool. |

## Public methods

### equals

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

### getPlayAsPointSourceResult

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

```
public final int getPlayAsPointSourceResult()
```

The value that will be returned by the `https://developer.android.com/reference/androidx/xr/scenecore/SpatialSoundPool#play(androidx.xr.runtime.Session,android.media.SoundPool,kotlin.Int,androidx.xr.scenecore.PointSourceParams,androidx.xr.scenecore.Entity,kotlin.Float,kotlin.Int,kotlin.Int,kotlin.Float)` method for point source audio.

Setting this property allows tests to simulate both successful and failed attempts to play a sound. A non-zero value simulates a successful playback, while `0` simulates a failure (e.g., because no more streams are available).

### getPlayAsSoundFieldResult

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

```
public final int getPlayAsSoundFieldResult()
```

The value that will be returned by the `https://developer.android.com/reference/androidx/xr/scenecore/SpatialSoundPool#play(androidx.xr.runtime.Session,android.media.SoundPool,kotlin.Int,androidx.xr.scenecore.PointSourceParams,androidx.xr.scenecore.Entity,kotlin.Float,kotlin.Int,kotlin.Int,kotlin.Float)` method for sound field audio.

Setting this property allows tests to simulate both successful and failed attempts to play a sound. A non-zero value simulates a successful playback, while `0` simulates a failure (e.g., because no more streams are available).

### getSpatialSourceType

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

```
public final @NonNull SpatializerConstants.SourceType getSpatialSourceType()
```

The spatial source type which can be retrieved from `https://developer.android.com/reference/androidx/xr/scenecore/SpatialSoundPool#getSpatialSourceType(androidx.xr.runtime.Session,android.media.SoundPool,kotlin.Int)` of the sound pool.

### hashCode

```
public int hashCode()
```

### setPlayAsPointSourceResult

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

```
public final void setPlayAsPointSourceResult(int value)
```

The value that will be returned by the `https://developer.android.com/reference/androidx/xr/scenecore/SpatialSoundPool#play(androidx.xr.runtime.Session,android.media.SoundPool,kotlin.Int,androidx.xr.scenecore.PointSourceParams,androidx.xr.scenecore.Entity,kotlin.Float,kotlin.Int,kotlin.Int,kotlin.Float)` method for point source audio.

Setting this property allows tests to simulate both successful and failed attempts to play a sound. A non-zero value simulates a successful playback, while `0` simulates a failure (e.g., because no more streams are available).

### setPlayAsSoundFieldResult

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

```
public final void setPlayAsSoundFieldResult(int value)
```

The value that will be returned by the `https://developer.android.com/reference/androidx/xr/scenecore/SpatialSoundPool#play(androidx.xr.runtime.Session,android.media.SoundPool,kotlin.Int,androidx.xr.scenecore.PointSourceParams,androidx.xr.scenecore.Entity,kotlin.Float,kotlin.Int,kotlin.Int,kotlin.Float)` method for sound field audio.

Setting this property allows tests to simulate both successful and failed attempts to play a sound. A non-zero value simulates a successful playback, while `0` simulates a failure (e.g., because no more streams are available).

### setSpatialSourceType

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

```
public final void setSpatialSourceType(@NonNull SpatializerConstants.SourceType value)
```

The spatial source type which can be retrieved from `https://developer.android.com/reference/androidx/xr/scenecore/SpatialSoundPool#getSpatialSourceType(androidx.xr.runtime.Session,android.media.SoundPool,kotlin.Int)` of the sound pool.