SpatialAudioTrackTester


class SpatialAudioTrackTester


Test utility class for spatial audio extensions.

This class provides a mechanism for tests to inspect and verify spatial audio attributes associated with an AudioTrack that are otherwise encapsulated within the SceneCore runtime.

Summary

Public functions

open operator Boolean
equals(other: Any?)
open Int
Boolean

Checks whether the given entity is the current point source for this AudioTrack.

Unit
setSoundFieldAttributes(
    track: AudioTrack,
    soundFieldAttributes: SoundFieldAttributes
)

Sets the SoundFieldAttributes associated with this audio track.

Unit

Sets the 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-beta01
fun isCurrentPointSource(track: AudioTrack, entity: Entity): Boolean

Checks whether the given entity is the current point source for this AudioTrack.

This returns true if the entity was passed to SpatialAudioTrack.setPointSourceParams as a point source.

Parameters
track: AudioTrack

The AudioTrack from SpatialAudioTrack.setPointSourceParams.

entity: Entity

The target Entity to check against.

Returns
Boolean

true if the entity is the current point source for this track, false otherwise.

setSoundFieldAttributes

Added in 1.0.0-beta01
fun setSoundFieldAttributes(
    track: AudioTrack,
    soundFieldAttributes: SoundFieldAttributes
): Unit

Sets the SoundFieldAttributes associated with this audio track.

This value needs to be set in the SpatialAudioTrackTester in order to test SpatialAudioTrack.getSoundFieldAttributes because there is currently no way to internally associate an AudioTrack with the AudioTrack.Builder used to create it.

Parameters
track: AudioTrack

The AudioTrack on which to set the SoundFieldAttributes.

soundFieldAttributes: SoundFieldAttributes

The SoundFieldAttributes to be set.

setSpatialSourceType

Added in 1.0.0-beta01
fun setSpatialSourceType(
    track: AudioTrack,
    sourceType: SpatializerConstants.SourceType
): Unit

Sets the SourceType of this audio track.

This value needs to be set in the SpatialAudioTrackTester in order to test SpatialAudioTrack.getSpatialSourceType because there is currently no way to internally associate an AudioTrack with the AudioTrack.Builder used to create it.

Parameters
track: AudioTrack

The AudioTrack on which to set the SpatializerConstants.SourceType.

sourceType: SpatializerConstants.SourceType

The SpatializerConstants.SourceType of the provided track.