SpatialSoundPool
public static class SpatialSoundPool
Provides spatial audio extensions on the framework SoundPool class.
Summary
Constants |
|
|---|---|
static final int |
PLAY_FAILED = 0Indicates the failure of a |
Public fields |
|
|---|---|
static @NonNull SpatialSoundPool |
Public methods |
|
|---|---|
final @NonNull SpatializerConstants.SourceType |
getSpatialSourceType( |
static final int |
play(Plays a spatialized sound effect as a sound field. |
static final int |
play(Plays a spatialized sound effect emitted from the |
Constants
PLAY_FAILED
public static final int PLAY_FAILED = 0
Indicates the failure of a play method.
Public fields
Public methods
getSpatialSourceType
public final @NonNull SpatializerConstants.SourceType getSpatialSourceType(
@NonNull Session session,
@NonNull SoundPool soundPool,
int streamId
)
| Parameters | |
|---|---|
@NonNull Session session |
The current |
@NonNull SoundPool soundPool |
The |
int streamId |
a streamID returned by the |
| Returns | |
|---|---|
@NonNull SpatializerConstants.SourceType |
The |
play
public static final int play(
@NonNull Session session,
@NonNull SoundPool soundPool,
int soundID,
@NonNull SoundFieldAttributes attributes,
@FloatRange(from = 0.0, to = 1.0) float volume,
@IntRange(from = 0) int priority,
@IntRange(from = -1) int loop,
@FloatRange(from = 0.5, to = 2.0) float rate
)
Plays a spatialized sound effect as a sound field.
| Parameters | |
|---|---|
@NonNull Session session |
The current |
@NonNull SoundPool soundPool |
The |
int soundID |
a soundId returned by the |
@NonNull SoundFieldAttributes attributes |
|
@FloatRange(from = 0.0, to = 1.0) float volume |
value (range = 0.0 to 1.0) |
@IntRange(from = 0) int priority |
stream priority (0 = lowest priority) |
@IntRange(from = -1) int loop |
loop mode (0 = no loop, -1 = loop forever, N = loop N times) |
@FloatRange(from = 0.5, to = 2.0) float rate |
playback rate (1.0 = normal playback, range 0.5 to 2.0) |
| Returns | |
|---|---|
int |
non-zero streamID if successful, |
play
public static final int play(
@NonNull Session session,
@NonNull SoundPool soundPool,
int soundID,
@NonNull PointSourceParams params,
@FloatRange(from = 0.0, to = 1.0) float volume,
@IntRange(from = 0) int priority,
@IntRange(from = -1) int loop,
@FloatRange(from = 0.5, to = 2.0) float rate
)
Plays a spatialized sound effect emitted from the Entity in the PointSourceParams.
| Parameters | |
|---|---|
@NonNull Session session |
The current |
@NonNull SoundPool soundPool |
The |
int soundID |
a soundId returned by the |
@NonNull PointSourceParams params |
|
@FloatRange(from = 0.0, to = 1.0) float volume |
value (range = 0.0 to 1.0) |
@IntRange(from = 0) int priority |
stream priority (0 = lowest priority) |
@IntRange(from = -1) int loop |
loop mode (0 = no loop, -1 = loop forever, N = loop N times) |
@FloatRange(from = 0.5, to = 2.0) float rate |
playback rate (1.0 = normal playback, range 0.5 to 2.0) |
| Returns | |
|---|---|
int |
non-zero streamID if successful, |