AudioManager class

Properties

audioList List<AudioInfo>
list of playback. Used to record playlists
getter/setter pair
auto bool
Whether to auto play. default true
no setter
curIndex int
Currently playing subscript of audioList
no setter
duration Duration
Total current playing time (ms
no setter
error String?
If there are errors, return details
no setter
hashCode int
The hash code for this object.
no setterinherited
info AudioInfo?
Playback info
no setter
intercepter bool
Whether to internally handle next and previous events. default true
getter/setter pair
isLoading bool
是否资源加载中
no setter
isPlaying bool
Current playback status
no setter
platformVersion Future<String>
no setter
playMode PlayMode
Play mode sequence, shuffle, single, default sequence
no setter
position Duration
Current playing time (ms
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
volume double
get current volume 0~1
no setter

Methods

file(File file, String title, {required String desc, required String cover, required bool auto}) Future<String>
This will load the file from the file-URI given by: 'file://${file.path}'.
getCurrentVolume() Future<double>
get current volume
next() Future<String>
play next audio
nextMode({PlayMode? playMode, int? index}) PlayMode
Switch playback mode. Playmode priority is greater than index
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onEvents(Events events) → void
callback events
play({int? index, bool? auto}) Future<String>
Play specified subscript audio if you want
playOrPause() Future<bool>
Play or pause; that is, pause if currently playing, otherwise play
previous() Future<String>
play previous audio
release() → dynamic
release all resource
seekTo(Duration position) Future<String>
position Move location millisecond timestamp.
setRate(AudioRate rate) Future<String>
rate Play rate, default AudioRate.rate100 is 1.0
setVolume(double value, {bool showVolume = false}) Future<String>
set volume range(0~1). showVolume: show volume view or not and this is only in iOS ⚠️ IOS simulator is invalid, please use real machine
start(String url, String title, {required String desc, required String cover, bool? auto}) Future<String>
Initial playback. Preloaded playback information
startInfo(AudioInfo audio, {required bool auto}) Future<String>
stop() → dynamic
stop play
toPause() Future<bool>
to pause status
toPlay() Future<bool>
to play status
toString() String
A string representation of this object.
inherited
updateLrc(String lrc) → dynamic
Update play details

Operators

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

Static Properties

instance AudioManager
no setter