SpatialAudioTrackTester


public final 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 methods

boolean
equals(Object other)
int
final boolean

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

final void
setSoundFieldAttributes(
    @NonNull AudioTrack track,
    @NonNull SoundFieldAttributes soundFieldAttributes
)

Sets the SoundFieldAttributes associated with this audio track.

final void

Sets the SourceType of this audio track.

Public methods

equals

public boolean equals(Object other)

hashCode

public int hashCode()

isCurrentPointSource

Added in 1.0.0-beta01
public final boolean isCurrentPointSource(@NonNull AudioTrack track, @NonNull Entity entity)

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
@NonNull AudioTrack track

The AudioTrack from SpatialAudioTrack.setPointSourceParams.

@NonNull 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
public final void setSoundFieldAttributes(
    @NonNull AudioTrack track,
    @NonNull SoundFieldAttributes soundFieldAttributes
)

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
@NonNull AudioTrack track

The AudioTrack on which to set the SoundFieldAttributes.

@NonNull SoundFieldAttributes soundFieldAttributes

The SoundFieldAttributes to be set.

setSpatialSourceType

Added in 1.0.0-beta01
public final void setSpatialSourceType(
    @NonNull AudioTrack track,
    @NonNull SpatializerConstants.SourceType sourceType
)

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
@NonNull AudioTrack track

The AudioTrack on which to set the SpatializerConstants.SourceType.

@NonNull SpatializerConstants.SourceType sourceType

The SpatializerConstants.SourceType of the provided track.