SpatialAudioTrack


object SpatialAudioTrack


Provides spatial audio extensions on the framework AudioTrack class.

Summary

Public functions

PointSourceParams?

Gets the PointSourceParams of the provided AudioTrack.

SoundFieldAttributes?

Gets the SoundFieldAttributes of the provided AudioTrack.

Int

Gets the SpatializerConstants.SourceType of the provided AudioTrack.

Unit
setPointSourceParams(
    session: Session,
    track: AudioTrack,
    params: PointSourceParams
)

Sets a new PointSourceParams on the provided AudioTrack.

Public functions

getPointSourceParams

Added in 1.0.0-alpha07
fun getPointSourceParams(session: Session, track: AudioTrack): PointSourceParams?

Gets the PointSourceParams of the provided AudioTrack.

Parameters
session: Session

The current Session instance.

track: AudioTrack

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-alpha07
fun getSoundFieldAttributes(session: Session, track: AudioTrack): SoundFieldAttributes?

Gets the SoundFieldAttributes of the provided AudioTrack.

Parameters
session: Session

The current Session instance.

track: AudioTrack

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-alpha07
fun getSpatialSourceType(session: Session, track: AudioTrack): Int

Gets the SpatializerConstants.SourceType of the provided AudioTrack. If setPointSourceParams has not yet been called, this value is determined by how the SpatialAudioTrackBuilder was constructed. Will return SpatializerConstants.SOURCE_TYPE_DEFAULT for tracks that didn't use spatial audio attributes.

Parameters
session: Session

The current Session instance.

track: AudioTrack

The AudioTrack from which to get the SpatializerConstants.SourceType.

Returns
Int

The SpatializerConstants.SourceType of the provided track.

setPointSourceParams

Added in 1.0.0-alpha07
fun setPointSourceParams(
    session: Session,
    track: AudioTrack,
    params: PointSourceParams
): Unit

Sets a new PointSourceParams on the provided AudioTrack.

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

Parameters
session: Session

The current Session instance.

track: AudioTrack

The AudioTrack on which to set the PointSourceParams.

params: PointSourceParams

The PointSourceParams to be set.