SpatialAudioTrack
public static class SpatialAudioTrack
Provides spatial audio extensions on the framework AudioTrack class.
Summary
Public fields |
|
|---|---|
static @NonNull SpatialAudioTrack |
Public methods |
|
|---|---|
static final PointSourceParams |
getPointSourceParams(@NonNull Session session, @NonNull AudioTrack track)Gets the |
static final SoundFieldAttributes |
getSoundFieldAttributes(Gets the |
static final @NonNull SpatializerConstants.SourceType |
getSpatialSourceType(@NonNull Session session, @NonNull AudioTrack track)Gets the |
static final void |
setPointSourceParams(Sets a new |
Public fields
Public methods
getPointSourceParams
public static final PointSourceParams getPointSourceParams(@NonNull Session session, @NonNull AudioTrack track)
Gets the PointSourceParams of the provided AudioTrack.
| Parameters | |
|---|---|
@NonNull Session session |
The current |
@NonNull AudioTrack track |
The |
| Returns | |
|---|---|
PointSourceParams |
The |
getSoundFieldAttributes
public static final SoundFieldAttributes getSoundFieldAttributes(
@NonNull Session session,
@NonNull AudioTrack track
)
Gets the SoundFieldAttributes of the provided AudioTrack.
| Parameters | |
|---|---|
@NonNull Session session |
The current |
@NonNull AudioTrack track |
The |
| Returns | |
|---|---|
SoundFieldAttributes |
The |
getSpatialSourceType
public static final @NonNull SpatializerConstants.SourceType getSpatialSourceType(@NonNull Session session, @NonNull AudioTrack track)
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.SourceType.DEFAULT for tracks that didn't use spatial audio attributes.
| Parameters | |
|---|---|
@NonNull Session session |
The current |
@NonNull AudioTrack track |
The |
| Returns | |
|---|---|
@NonNull SpatializerConstants.SourceType |
The |
setPointSourceParams
public static final void setPointSourceParams(
@NonNull Session session,
@NonNull AudioTrack track,
@NonNull PointSourceParams params,
@NonNull Entity entity
)
Sets a new PointSourceParams on the provided AudioTrack.
The new PointSourceParams will be applied if the SpatializerConstants.SourceType of the AudioTrack was either SpatializerConstants.SourceType.DEFAULT or SpatializerConstants.SourceType.POINT_SOURCE. If the SpatializerConstants.SourceType was SpatializerConstants.SourceType.SOUND_FIELD, then this method will throw an IllegalStateException.
| Parameters | |
|---|---|
@NonNull Session session |
The current |
@NonNull AudioTrack track |
The |
@NonNull PointSourceParams params |
The |
@NonNull Entity entity |
The |
| Throws | |
|---|---|
IllegalStateException |
if the |
IllegalArgumentException |
if the |