# SpatialAudioTrackTester

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

*** ** * ** ***


```
class SpatialAudioTrackTester
```

<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.html` that are otherwise encapsulated within the SceneCore runtime.

## 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/SpatialAudioTrackTester#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/SpatialAudioTrackTester#hashCode()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/SpatialAudioTrackTester#isCurrentPointSource(android.media.AudioTrack,androidx.xr.scenecore.Entity)(track: https://developer.android.com/reference/android/media/AudioTrack.html, entity: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Entity)` Checks whether the given `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/SpatialAudioTrackTester#isCurrentPointSource(android.media.AudioTrack,androidx.xr.scenecore.Entity)` is the current point source for this `https://developer.android.com/reference/android/media/AudioTrack.html`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/SpatialAudioTrackTester#setSoundFieldAttributes(android.media.AudioTrack,androidx.xr.scenecore.SoundFieldAttributes)( track: https://developer.android.com/reference/android/media/AudioTrack.html, soundFieldAttributes: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/SoundFieldAttributes )` Sets the `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/SoundFieldAttributes` associated with this audio track. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/SpatialAudioTrackTester#setSpatialSourceType(android.media.AudioTrack,androidx.xr.scenecore.SpatializerConstants.SourceType)( track: https://developer.android.com/reference/android/media/AudioTrack.html, sourceType: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/SpatializerConstants.SourceType )` Sets the `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/SpatializerConstants.SourceType` of this audio track. |

## Public functions

### equals

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

### hashCode

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

### isCurrentPointSource

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

```
fun isCurrentPointSource(track: AudioTrack, entity: Entity): Boolean
```

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

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

| Parameters |
|---|---|
| `track: https://developer.android.com/reference/android/media/AudioTrack.html` | The `https://developer.android.com/reference/android/media/AudioTrack.html` from `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/SpatialAudioTrack#setPointSourceParams(androidx.xr.runtime.Session,android.media.AudioTrack,androidx.xr.scenecore.PointSourceParams,androidx.xr.scenecore.Entity)`. |
| `entity: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Entity` | The target `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Entity` to check against. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `true` if the `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/SpatialAudioTrackTester#isCurrentPointSource(android.media.AudioTrack,androidx.xr.scenecore.Entity)` is the current point source for this track, `false` otherwise. |

### setSoundFieldAttributes

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

```
fun setSoundFieldAttributes(
    track: AudioTrack,
    soundFieldAttributes: SoundFieldAttributes
): Unit
```

Sets the `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/SoundFieldAttributes` associated with this audio track.

This value needs to be set in the `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/SpatialAudioTrackTester` in order to test `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/SpatialAudioTrack#getSoundFieldAttributes(androidx.xr.runtime.Session,android.media.AudioTrack)` because there is currently no way to internally associate an `https://developer.android.com/reference/android/media/AudioTrack.html` with the `https://developer.android.com/reference/android/media/AudioTrack.Builder.html` used to create it.

| Parameters |
|---|---|
| `track: https://developer.android.com/reference/android/media/AudioTrack.html` | The `https://developer.android.com/reference/android/media/AudioTrack.html` on which to set the `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/SoundFieldAttributes`. |
| `soundFieldAttributes: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/SoundFieldAttributes` | The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/SoundFieldAttributes` to be set. |

### setSpatialSourceType

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

```
fun setSpatialSourceType(
    track: AudioTrack,
    sourceType: SpatializerConstants.SourceType
): Unit
```

Sets the `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/SpatializerConstants.SourceType` of this audio track.

This value needs to be set in the `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/SpatialAudioTrackTester` in order to test `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/SpatialAudioTrack#getSpatialSourceType(androidx.xr.runtime.Session,android.media.AudioTrack)` because there is currently no way to internally associate an `https://developer.android.com/reference/android/media/AudioTrack.html` with the `https://developer.android.com/reference/android/media/AudioTrack.Builder.html` used to create it.

| Parameters |
|---|---|
| `track: https://developer.android.com/reference/android/media/AudioTrack.html` | The `https://developer.android.com/reference/android/media/AudioTrack.html` on which to set the `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/SpatializerConstants.SourceType`. |
| `sourceType: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/SpatializerConstants.SourceType` | The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/SpatializerConstants.SourceType` of the provided track. |