Package org.robolectric.shadows
Class ShadowSoundPool
java.lang.Object
org.robolectric.shadows.ShadowSoundPool
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Record of a single call toSoundPool.play(int, float, float, int, int, float)
. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected int
_play
(int soundID, float leftVolume, float rightVolume, int priority, int loop, float rate) protected int
_play
(int soundID, float leftVolume, float rightVolume, int priority, int loop, float rate, int playerIId) void
Clears the sounds played by this SoundPool.getPathPlaybacks
(String path) Return a list of calls toplay
made for the given path.getResourcePlaybacks
(int resId) Return a list of calls toplay
made for the given resource.protected static IAudioService
protected int
protected int
void
notifyPathLoaded
(String path, boolean success) Notify theSoundPool.OnLoadCompleteListener
, if present, that the given path was loaded.void
notifyResourceLoaded
(int resId, boolean success) Notify theSoundPool.OnLoadCompleteListener
, if present, that the given resource was loaded.protected void
boolean
wasPathPlayed
(String path) Returnstrue
if the given path was played.boolean
wasResourcePlayed
(int resId) Returnstrue
if the given resource was played.
-
Constructor Details
-
ShadowSoundPool
public ShadowSoundPool()
-
-
Method Details
-
getService
-
_play
@Implementation(minSdk=23, maxSdk=33) protected int _play(int soundID, float leftVolume, float rightVolume, int priority, int loop, float rate) -
_play
@Implementation(minSdk=34) protected int _play(int soundID, float leftVolume, float rightVolume, int priority, int loop, float rate, int playerIId) -
load
-
load
-
setOnLoadCompleteListener
-
notifyPathLoaded
Notify theSoundPool.OnLoadCompleteListener
, if present, that the given path was loaded. -
notifyResourceLoaded
public void notifyResourceLoaded(int resId, boolean success) Notify theSoundPool.OnLoadCompleteListener
, if present, that the given resource was loaded. -
wasPathPlayed
Returnstrue
if the given path was played. -
wasResourcePlayed
public boolean wasResourcePlayed(int resId) Returnstrue
if the given resource was played. -
getPathPlaybacks
Return a list of calls toplay
made for the given path. -
getResourcePlaybacks
Return a list of calls toplay
made for the given resource. -
clearPlayed
public void clearPlayed()Clears the sounds played by this SoundPool.
-