Constructor and Description |
---|
Builder()
Constructs a new Builder with the defaults format values.
|
Modifier and Type | Method and Description |
---|---|
SoundPool |
build() |
SoundPool.Builder |
setAudioAttributes(AudioAttributes attributes)
Sets the
AudioAttributes . |
SoundPool.Builder |
setMaxStreams(int maxStreams)
Sets the maximum of number of simultaneous streams that can be played simultaneously.
|
public Builder()
setMaxStreams(int)
to
change it), and the audio attributes have a usage value of
AudioAttributes.USAGE_MEDIA
(see setAudioAttributes(AudioAttributes)
to
change them).public SoundPool.Builder setMaxStreams(int maxStreams) throws IllegalArgumentException
maxStreams
- a value equal to 1 or greater.IllegalArgumentException
public SoundPool.Builder setAudioAttributes(AudioAttributes attributes) throws IllegalArgumentException
AudioAttributes
. For examples, game applications will use attributes
built with usage information set to AudioAttributes.USAGE_GAME
.attributes
- a non-nullIllegalArgumentException
public SoundPool build()