@Implements(value=android.media.SoundPool.class) public class ShadowSoundPool extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ShadowSoundPool.Playback
Record of a single call to
SoundPool.play(int, float, float, int, int, float) . |
Constructor and Description |
---|
ShadowSoundPool() |
Modifier and Type | Method and Description |
---|---|
protected int |
_play(int soundID,
float leftVolume,
float rightVolume,
int priority,
int loop,
float rate) |
void |
clearPlayed()
Clears the sounds played by this SoundPool.
|
java.util.List<ShadowSoundPool.Playback> |
getPathPlaybacks(java.lang.String path)
Return a list of calls to
play made for the given path. |
java.util.List<ShadowSoundPool.Playback> |
getResourcePlaybacks(int resId)
Return a list of calls to
play made for the given resource. |
protected static android.media.IAudioService |
getService() |
protected int |
load(android.content.Context context,
int resId,
int priority) |
protected int |
load(java.lang.String path,
int priority) |
protected int |
play(int soundID,
float leftVolume,
float rightVolume,
int priority,
int loop,
float rate) |
boolean |
wasPathPlayed(java.lang.String path)
Returns
true if the given path was played. |
boolean |
wasResourcePlayed(int resId)
Returns
true if the given resource was played. |
@Implementation(minSdk=24, maxSdk=25) protected static android.media.IAudioService getService()
@Implementation(maxSdk=22) protected int play(int soundID, float leftVolume, float rightVolume, int priority, int loop, float rate)
@Implementation(minSdk=23) protected int _play(int soundID, float leftVolume, float rightVolume, int priority, int loop, float rate)
@Implementation protected int load(java.lang.String path, int priority)
@Implementation protected int load(android.content.Context context, int resId, int priority)
public boolean wasPathPlayed(java.lang.String path)
Returns true
if the given path was played.
public boolean wasResourcePlayed(int resId)
Returns true
if the given resource was played.
public java.util.List<ShadowSoundPool.Playback> getPathPlaybacks(java.lang.String path)
Return a list of calls to play
made for the given path.
public java.util.List<ShadowSoundPool.Playback> getResourcePlaybacks(int resId)
Return a list of calls to play
made for the given resource.
public void clearPlayed()
Clears the sounds played by this SoundPool.