SpatialMediaPlayer


public static class SpatialMediaPlayer


Provides spatial audio extensions on the framework MediaPlayer class.

Summary

Public fields

static @NonNull SpatialMediaPlayer

Public methods

static final void
setPointSourceParams(
    @NonNull Session session,
    @NonNull MediaPlayer mediaPlayer,
    @NonNull PointSourceParams params
)

Sets a PointSourceParams on a MediaPlayer instance.

static final void
setSoundFieldAttributes(
    @NonNull Session session,
    @NonNull MediaPlayer mediaPlayer,
    @NonNull SoundFieldAttributes attributes
)

Sets a SoundFieldAttributes on a MediaPlayer instance.

Public fields

INSTANCE

Added in 1.0.0-alpha07
public static @NonNull SpatialMediaPlayer INSTANCE

Public methods

setPointSourceParams

Added in 1.0.0-alpha07
public static final void setPointSourceParams(
    @NonNull Session session,
    @NonNull MediaPlayer mediaPlayer,
    @NonNull PointSourceParams params
)

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
@NonNull Session session

The current Session instance.

@NonNull MediaPlayer mediaPlayer

The MediaPlayer instance on which to set the params

@NonNull PointSourceParams params

The source params to be set.

setSoundFieldAttributes

Added in 1.0.0-alpha07
public static final void setSoundFieldAttributes(
    @NonNull Session session,
    @NonNull MediaPlayer mediaPlayer,
    @NonNull SoundFieldAttributes attributes
)

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
@NonNull Session session

The current Session instance.

@NonNull MediaPlayer mediaPlayer

The MediaPlayer instance on which to set the attributes

@NonNull SoundFieldAttributes attributes

The source attributes to be set.