Soundpool class

Constructors

Soundpool({StreamType streamType = StreamType.music, int maxStreams = 1})
Creates the Soundpool instance with stream type setting set. Soundpool can play up to maxStreams of simultaneous streams
factory
Soundpool.fromOptions({SoundpoolOptions options = SoundpoolOptions.kDefault})
Creates the Soundpool instance with stream type setting set.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
streamType StreamType
no setter

Methods

dispose() → void
Disposes soundpool
load(ByteData rawSound, {int priority = _DEFAULT_SOUND_PRIORITY}) Future<int>
Prepares sound for playing
loadAndPlay(ByteData rawSound, {int priority = _DEFAULT_SOUND_PRIORITY, int repeat = 0, double rate = 1.0}) Future<int>
Prepares sound for playing and plays immediately when loaded
loadAndPlayUint8List(Uint8List rawSound, {int priority = _DEFAULT_SOUND_PRIORITY, int repeat = 0, double rate = 1.0}) Future<int>
Prepares sound for playing and plays immediately after loading
loadAndPlayUri(String uri, {int priority = _DEFAULT_SOUND_PRIORITY, int repeat = 0, double rate = 1.0}) Future<int>
Prepares sound for playing and plays immediately after loading
loadUint8List(Uint8List rawSound, {int priority = _DEFAULT_SOUND_PRIORITY}) Future<int>
Prepares sound for playing
loadUri(String uri, {int priority = _DEFAULT_SOUND_PRIORITY}) Future<int>
Prepares sound for playing
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pause(int streamId) Future<void>
Pauses playing sound identified by streamId
play(int soundId, {int repeat = 0, double rate = 1.0}) Future<int>
Plays sound identified by soundId
playWithControls(int soundId, {int repeat = 0, double rate = 1.0}) Future<AudioStreamControl>
Starts playing the sound identified by soundId.
release() Future<void>
Releases loaded sounds
resume(int streamId) Future<void>
Resumes playing sound identified by streamId
setRate({required int streamId, required double playbackRate}) Future<void>
Sets playback rate. A value of 1.0 means normal speed, 0.5 - half speed, 2.0 - double speed.
setVolume({int? soundId, int? streamId, double? volume, double? volumeLeft, double? volumeRight}) Future<void>
Sets volume for playing sound identified by soundId or streamId
stop(int streamId) Future<void>
Stops playing sound identified by streamId
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited