Home | History | Annotate | Download | only in media

Lines Matching refs:soundPool

43  * The SoundPool class manages and plays audio resources for applications.
45 * <p>A SoundPool is a collection of samples that can be loaded into memory
47 * SoundPool library uses the MediaPlayer service to decode the audio
52 * <p>In addition to low-latency playback, SoundPool can also manage the number
53 * of audio streams being rendered at once. When the SoundPool object is
55 * that can be played at a time from this single SoundPool. SoundPool tracks
57 * SoundPool will automatically stop a previously playing stream based first
78 * the SoundPool was created. In this case, the stream allocator will stop
87 * by that level. In this case, the game logic should create a new SoundPool
90 * through the list of sounds calling the appropriate SoundPool.load()
96 * trigger sounds by calling SoundPool.play(). Playing streams can be
109 * logic should call SoundPool.release() to release all the native resources
110 * in use and then set the SoundPool reference to null. If the player starts
111 * another level, a new SoundPool is created, sounds are loaded, and play
114 public class SoundPool extends PlayerBase {
115 static { System.loadLibrary("soundpool"); }
117 // SoundPool messages
119 // must match SoundPool.h
122 private final static String TAG = "SoundPool";
128 private SoundPool.OnLoadCompleteListener mOnLoadCompleteListener;
135 * Constructor. Constructs a SoundPool object with the following
139 * SoundPool object
145 * @return a SoundPool object, or null if creation failed
146 * @deprecated use {@link SoundPool.Builder} instead to create and configure a
147 * SoundPool instance
149 public SoundPool(int maxStreams, int streamType, int srcQuality) {
152 PlayerBase.deprecateStreamTypeForPlayback(streamType, "SoundPool", "SoundPool()");
155 private SoundPool(int maxStreams, AudioAttributes attributes) {
159 if (native_setup(new WeakReference<SoundPool>(this), maxStreams, attributes) != 0) {
169 * Release the SoundPool resources.
171 * Release all memory and native resources used by the SoundPool
172 * object. The SoundPool can no longer be used and the reference
483 * @param soundPool SoundPool object from the load() method
487 public void onLoadComplete(SoundPool soundPool, int sampleId, int status);
527 SoundPool soundPool = ((WeakReference<SoundPool>) ref).get();
528 if (soundPool == null)
531 if (soundPool.mEventHandler != null) {
532 Message m = soundPool.mEventHandler.obtainMessage(msg, arg1, arg2, obj);
533 soundPool.mEventHandler.sendMessage(m);
549 mOnLoadCompleteListener.onLoadComplete(SoundPool.this, msg.arg1, msg.arg2);
561 * Builder class for {@link SoundPool} objects.
607 public SoundPool build() {
612 return new SoundPool(mMaxStreams, mAudioAttributes);