SpatialSoundPool


class SpatialSoundPool


Provides spatial audio extensions on the framework SoundPool class.

Summary

Public companion functions

Int
getSpatialSourceType(session: Session, soundPool: SoundPool, streamId: Int)
Int
play(
    session: Session,
    soundPool: SoundPool,
    soundID: Int,
    attributes: PointSourceAttributes,
    volume: Float,
    priority: Int,
    loop: Int,
    rate: Float
)

Plays a spatialized sound effect emitted relative Node in the PointSourceAttributes.

Int
play(
    session: Session,
    soundPool: SoundPool,
    soundID: Int,
    attributes: SoundFieldAttributes,
    volume: Float,
    priority: Int,
    loop: Int,
    rate: Float
)

Plays a spatialized sound effect as a sound field.

Public companion functions

getSpatialSourceType

Added in 1.0.0-alpha01
fun getSpatialSourceType(session: Session, soundPool: SoundPool, streamId: Int): Int
Parameters
session: Session

The current SceneCore Session instance.

soundPool: SoundPool

The SoundPool to use to get its SourceType.

streamId: Int

a streamID returned by the play(), playAsPointSource(), or playAsSoundField().

Returns
Int

The SpatializerConstants.SourceType for the given streamID.

play

Added in 1.0.0-alpha01
fun play(
    session: Session,
    soundPool: SoundPool,
    soundID: Int,
    attributes: PointSourceAttributes,
    volume: Float,
    priority: Int,
    loop: Int,
    rate: Float
): Int

Plays a spatialized sound effect emitted relative Node in the PointSourceAttributes.

Parameters
session: Session

The current SceneCore Session instance.

soundPool: SoundPool

The SoundPool to use to the play the sound.

soundID: Int

a soundId returned by the load() function.

attributes: PointSourceAttributes

attributes to specify sound source. PointSourceAttributes

volume: Float

value (range = 0.0 to 1.0)

priority: Int

stream priority (0 = lowest priority)

loop: Int

loop mode (0 = no loop, -1 = loop forever, N = loop N times)

rate: Float

playback rate (1.0 = normal playback, range 0.5 to 2.0)

Returns
Int

non-zero streamID if successful, zero if failed

play

Added in 1.0.0-alpha01
fun play(
    session: Session,
    soundPool: SoundPool,
    soundID: Int,
    attributes: SoundFieldAttributes,
    volume: Float,
    priority: Int,
    loop: Int,
    rate: Float
): Int

Plays a spatialized sound effect as a sound field.

Parameters
session: Session

The current SceneCore Session instance.

soundPool: SoundPool

The SoundPool to use to the play the sound.

soundID: Int

a soundId returned by the load() function.

attributes: SoundFieldAttributes

attributes to specify sound source. SoundFieldAttributes

volume: Float

value (range = 0.0 to 1.0)

priority: Int

stream priority (0 = lowest priority)

loop: Int

loop mode (0 = no loop, -1 = loop forever, N = loop N times)

rate: Float

playback rate (1.0 = normal playback, range 0.5 to 2.0)

Returns
Int

non-zero streamID if successful, zero if failed