SpatialMediaPlayer


object SpatialMediaPlayer


Provides spatial audio extensions on the framework MediaPlayer class.

Summary

Public functions

Unit
setPointSourceParams(
    session: Session,
    mediaPlayer: MediaPlayer,
    params: PointSourceParams
)

Sets a PointSourceParams on a MediaPlayer instance.

Unit
setSoundFieldAttributes(
    session: Session,
    mediaPlayer: MediaPlayer,
    attributes: SoundFieldAttributes
)

Sets a SoundFieldAttributes on a MediaPlayer instance.

Public functions

setPointSourceParams

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

Sets a PointSourceParams on a MediaPlayer instance.

Must be called before MediaPlayer.prepare. Not compatible with instances created by MediaPlayer.create. Only the params or attributes from the most recent call to this method or setSoundFieldAttributes will apply since they are mutually exclusive.

Parameters
session: Session

The current Session instance.

mediaPlayer: MediaPlayer

The MediaPlayer instance on which to set the params

params: PointSourceParams

The source params to be set.

setSoundFieldAttributes

Added in 1.0.0-alpha07
fun setSoundFieldAttributes(
    session: Session,
    mediaPlayer: MediaPlayer,
    attributes: SoundFieldAttributes
): Unit

Sets a SoundFieldAttributes on a MediaPlayer instance.

Must be called before MediaPlayer.prepare. Not compatible with instances created by MediaPlayer.create. Only the attributes or params from the most recent call to this method or setPointSourceParams will apply since they are mutually exclusive.

Parameters
session: Session

The current Session instance.

mediaPlayer: MediaPlayer

The MediaPlayer instance on which to set the attributes

attributes: SoundFieldAttributes

The source attributes to be set.