FakeSoundPoolExtensionsWrapper


public final class FakeSoundPoolExtensionsWrapper


Test-only implementation of SoundPoolExtensionsWrapper

Summary

Public constructors

Public methods

int
getSpatialSourceType(@NonNull SoundPool soundPool, int streamId)

Returns the spatial source type of the sound.

int
play(
    @NonNull SoundPool soundPool,
    int soundId,
    @NonNull SoundFieldAttributes attributes,
    float volume,
    int priority,
    int loop,
    float rate
)

Plays a sound as a sound field.

int
play(
    @NonNull SoundPool soundPool,
    int soundId,
    @NonNull PointSourceParams params,
    float volume,
    int priority,
    int loop,
    float rate
)

Plays a sound as a point source.

Public constructors

FakeSoundPoolExtensionsWrapper

Added in 1.0.0-alpha04
public FakeSoundPoolExtensionsWrapper()

Public methods

getSpatialSourceType

Added in 1.0.0-alpha04
public int getSpatialSourceType(@NonNull SoundPool soundPool, int streamId)

Returns the spatial source type of the sound.

Parameters
@NonNull SoundPool soundPool

The SoundPool to use.

int streamId

The stream ID of the sound.

Returns
int

The spatial source type of the sound.

play

Added in 1.0.0-alpha04
public int play(
    @NonNull SoundPool soundPool,
    int soundId,
    @NonNull SoundFieldAttributes attributes,
    float volume,
    int priority,
    int loop,
    float rate
)

Plays a sound as a sound field.

Parameters
@NonNull SoundPool soundPool

The SoundPool to use.

int soundId

The ID of the sound to play.

@NonNull SoundFieldAttributes attributes

The SoundFieldAttributes to use.

float volume

The volume of the sound.

int priority

The priority of the sound.

int loop

Whether to loop the sound.

float rate

The playback rate of the sound.

Returns
int

The result of the play operation.

play

Added in 1.0.0-alpha04
public int play(
    @NonNull SoundPool soundPool,
    int soundId,
    @NonNull PointSourceParams params,
    float volume,
    int priority,
    int loop,
    float rate
)

Plays a sound as a point source.

Parameters
@NonNull SoundPool soundPool

The SoundPool to use.

int soundId

The ID of the sound to play.

@NonNull PointSourceParams params

The PointSourceParams to use.

float volume

The volume of the sound.

int priority

The priority of the sound.

int loop

Whether to loop the sound.

float rate

The playback rate of the sound.

Returns
int

The result of the play operation.