SpatialAudioTrack


public final class SpatialAudioTrack


Summary

Public constructors

Public methods

static final PointSourceParams

Gets the PointSourceParams of the provided AudioTrack.

static final SoundFieldAttributes
getSoundFieldAttributes(
    @NonNull Session session,
    @NonNull AudioTrack track
)

Gets the SoundFieldAttributes of the provided AudioTrack.

static final int

Gets the SourceType of the provided AudioTrack.

static final void
setPointSourceParams(
    @NonNull Session session,
    @NonNull AudioTrack track,
    @NonNull PointSourceParams params
)

Sets a new PointSourceParams on the provided AudioTrack.

Public constructors

SpatialAudioTrack

Added in 1.0.0-alpha04
public SpatialAudioTrack()

Public methods

getPointSourceParams

Added in 1.0.0-alpha04
public static final PointSourceParams getPointSourceParams(@NonNull Session session, @NonNull AudioTrack track)

Gets the PointSourceParams of the provided AudioTrack.

Parameters
@NonNull Session session

The current SceneCore Session instance.

@NonNull AudioTrack track

The AudioTrack from which to get the PointSourceParams.

Returns
PointSourceParams

The PointSourceParams of the provided track, null if not set.

getSoundFieldAttributes

Added in 1.0.0-alpha04
public static final SoundFieldAttributes getSoundFieldAttributes(
    @NonNull Session session,
    @NonNull AudioTrack track
)

Gets the SoundFieldAttributes of the provided AudioTrack.

Parameters
@NonNull Session session

The current SceneCore Session instance.

@NonNull AudioTrack track

The AudioTrack from which to get the SoundFieldAttributes.

Returns
SoundFieldAttributes

The SoundFieldAttributes of the provided track, null if not set.

getSpatialSourceType

Added in 1.0.0-alpha04
public static final int getSpatialSourceType(@NonNull Session session, @NonNull AudioTrack track)

Gets the SourceType of the provided AudioTrack. If setPointSourceParams has not yet been called, this value is implicitly set by which type of attributes was used to configure the builder. Will return SpatializerConstants.DEFAULT for tracks that didn't use spatial audio attributes.

If setPointSourceParams is called and the SourceType was either SpatializerConstants.DEFAULT or SpatializerConstants.POINT_SOURCE, then the return value will be SpatializerConstants.POINT_SOURCE. If the SourceType was SpatializerConstants.SOUND_FIELD then the return value will remain SpatializerConstants.SOUND_FIELD.

Parameters
@NonNull Session session

The current SceneCore Session instance.

@NonNull AudioTrack track

The AudioTrack from which to get the SpatializerConstants.SourceType.

Returns
int

The SpatializerConstants.SourceType of the provided track.

setPointSourceParams

Added in 1.0.0-alpha04
public static final void setPointSourceParams(
    @NonNull Session session,
    @NonNull AudioTrack track,
    @NonNull PointSourceParams params
)

Sets a new PointSourceParams on the provided AudioTrack.

The new PointSourceParams will be applied if the SourceType of the AudioTrack was either SpatializerConstants.DEFAULT or SpatializerConstants.POINT_SOURCE. If the SourceType was SpatializerConstants.SOUND_FIELD, then this method will throw an IllegalStateException.

Parameters
@NonNull Session session

The current SceneCore Session instance.

@NonNull AudioTrack track

The AudioTrack on which to set the PointSourceParams.

@NonNull PointSourceParams params

The PointSourceParams to be set.

Throws
kotlin.IllegalStateException

if the SpatializerConstants.SourceType of the AudioTrack is SpatializerConstants.SOUND_FIELD.

kotlin.IllegalArgumentException

if the PointSourceParams is not able to be set.