# SpatialAudioTrackBuilderTester

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

*** ** * ** ***


```
public final class SpatialAudioTrackBuilderTester
```

<br />

*** ** * ** ***

Test utility class for spatial audio extensions.

This class provides a mechanism for tests to inspect and verify spatial audio attributes associated with an `https://developer.android.com/reference/android/media/AudioTrack.Builder.html` that are otherwise encapsulated within the SceneCore runtime.

## Summary

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SpatialAudioTrackBuilderTester#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final https://developer.android.com/reference/androidx/xr/scenecore/PointSourceParams` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SpatialAudioTrackBuilderTester#getPointSourceParams(android.media.AudioTrack.Builder)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/media/AudioTrack.Builder.html builder)` Retrieves the `https://developer.android.com/reference/androidx/xr/scenecore/PointSourceParams` set on the builder. |
| `final https://developer.android.com/reference/androidx/xr/scenecore/SoundFieldAttributes` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SpatialAudioTrackBuilderTester#getSoundFieldAttributes(android.media.AudioTrack.Builder)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/media/AudioTrack.Builder.html builder)` Retrieves the `https://developer.android.com/reference/androidx/xr/scenecore/SoundFieldAttributes` set on the builder. |
| `int` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SpatialAudioTrackBuilderTester#hashCode()()` |
| `final boolean` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SpatialAudioTrackBuilderTester#isCurrentPointSource(android.media.AudioTrack.Builder,androidx.xr.scenecore.Entity)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/media/AudioTrack.Builder.html builder, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Entity entity )` Checks whether the given `https://developer.android.com/reference/androidx/xr/scenecore/testing/SpatialAudioTrackBuilderTester#isCurrentPointSource(android.media.AudioTrack.Builder,androidx.xr.scenecore.Entity)` is the current point source for this `https://developer.android.com/reference/android/media/AudioTrack.Builder.html`. |

## Public methods

### equals

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

### getPointSourceParams

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

```
public final PointSourceParams getPointSourceParams(@NonNull AudioTrack.Builder builder)
```

Retrieves the `https://developer.android.com/reference/androidx/xr/scenecore/PointSourceParams` set on the builder.

This reflects values set via `https://developer.android.com/reference/androidx/xr/scenecore/SpatialAudioTrackBuilder#setPointSourceParams(androidx.xr.runtime.Session,android.media.AudioTrack.Builder,androidx.xr.scenecore.PointSourceParams,androidx.xr.scenecore.Entity)`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/media/AudioTrack.Builder.html builder` | The `https://developer.android.com/reference/android/media/AudioTrack.Builder.html` from which to get the `https://developer.android.com/reference/androidx/xr/scenecore/PointSourceParams`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/xr/scenecore/PointSourceParams` | The source params to be set. |

### getSoundFieldAttributes

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

```
public final SoundFieldAttributes getSoundFieldAttributes(@NonNull AudioTrack.Builder builder)
```

Retrieves the `https://developer.android.com/reference/androidx/xr/scenecore/SoundFieldAttributes` set on the builder.

This reflects values set via `https://developer.android.com/reference/androidx/xr/scenecore/SpatialAudioTrackBuilder#setSoundFieldAttributes(androidx.xr.runtime.Session,android.media.AudioTrack.Builder,androidx.xr.scenecore.SoundFieldAttributes)`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/media/AudioTrack.Builder.html builder` | The `https://developer.android.com/reference/android/media/AudioTrack.Builder.html` from which to get the `https://developer.android.com/reference/androidx/xr/scenecore/SoundFieldAttributes`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/xr/scenecore/SoundFieldAttributes` | The source attributes to be set. |

### hashCode

```
public int hashCode()
```

### isCurrentPointSource

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

```
public final boolean isCurrentPointSource(
    @NonNull AudioTrack.Builder builder,
    @NonNull Entity entity
)
```

Checks whether the given `https://developer.android.com/reference/androidx/xr/scenecore/testing/SpatialAudioTrackBuilderTester#isCurrentPointSource(android.media.AudioTrack.Builder,androidx.xr.scenecore.Entity)` is the current point source for this `https://developer.android.com/reference/android/media/AudioTrack.Builder.html`.

This returns `true` if the `https://developer.android.com/reference/androidx/xr/scenecore/testing/SpatialAudioTrackBuilderTester#isCurrentPointSource(android.media.AudioTrack.Builder,androidx.xr.scenecore.Entity)` was passed to `https://developer.android.com/reference/androidx/xr/scenecore/SpatialAudioTrackBuilder#setPointSourceParams(androidx.xr.runtime.Session,android.media.AudioTrack.Builder,androidx.xr.scenecore.PointSourceParams,androidx.xr.scenecore.Entity)` as a point source.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/media/AudioTrack.Builder.html builder` | The `https://developer.android.com/reference/android/media/AudioTrack.Builder.html` from `https://developer.android.com/reference/androidx/xr/scenecore/SpatialAudioTrackBuilder#setPointSourceParams(androidx.xr.runtime.Session,android.media.AudioTrack.Builder,androidx.xr.scenecore.PointSourceParams,androidx.xr.scenecore.Entity)`. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Entity entity` | The target `https://developer.android.com/reference/androidx/xr/scenecore/Entity` to check against. |

| Returns |
|---|---|
| `boolean` | `true` if the `https://developer.android.com/reference/androidx/xr/scenecore/testing/SpatialAudioTrackBuilderTester#isCurrentPointSource(android.media.AudioTrack.Builder,androidx.xr.scenecore.Entity)` is the current point source for this builder, `false` otherwise. |