SoundPlayer class

Constructors

SoundPlayer()
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

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

audioPlayer → AudioPlayer
Gets the current audio player instance
no setter
i → dynamic
no setter
instance SoundPlayer
Allows access to all SoundPlayer functions
final
isAudioEnabled bool
Checks if audio is _enable on the instance, if null, checks on local storage
no setter
prefs Future<SharedPreferences>
Gets the current shared preferences instance
no setter

Static Methods

checkLocalStorageEnabled() Future<bool>
Checks if audio is _enable locally
play(Sounds sound, {double volume = 1, Duration? position}) Future<void>
Checks if the selected sound is cached if is cached, plays the audio immediately else downloads and caches the audio and then plays it
playFromAssetPath(String asset, {double volume = 1, Duration? position}) → void
Plays the audio file of the given asset
playFromBytes(Uint8List bytes, {double volume = 1, Duration? position}) → void
Plays the audio file of the given bytes
playFromDeviceFilePath(String file, {double volume = 1, Duration? position}) → void
Plays the audio file of the given file
playFromUrl(String url, {double volume = 1, Duration? position}) → void
Plays the audio file of the fiven url path
setAudioEnabled(bool enable) → dynamic
Sets audio enable/disable