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