Stay organized with collections
Save and categorize content based on your preferences.
Builder
open class Builder
Builder class for SoundPool
objects.
Summary
Public constructors |
Constructs a new Builder with the defaults format values.
|
Public constructors
Public methods
setAudioSessionId
open fun setAudioSessionId(sessionId: Int): SoundPool.Builder
Sets the session ID the SoundPool
will be attached to. Note, that if there's a device specific session id associated with the context (see Builder.setContext(Context)
), explicitly setting a session id using this method will override it.
Exceptions |
java.lang.IllegalArgumentException |
when sessionId is invalid. |
setContext
open fun setContext(context: Context): SoundPool.Builder
Sets the context the SoundPool belongs to. The context will be used to pull information, such as android.content.AttributionSource
and device specific audio session ids, which will be associated with the SoundPool
. However, the context itself will not be retained by the SoundPool
instance after initialization.
setMaxStreams
open fun setMaxStreams(maxStreams: Int): SoundPool.Builder!
Sets the maximum of number of simultaneous streams that can be played simultaneously.
Parameters |
maxStreams |
Int: a value equal to 1 or greater. |
Exceptions |
java.lang.IllegalArgumentException |
|
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[]]