This repository has been archived by the owner on Sep 13, 2021. It is now read-only.
This version of flutter_audio_desktop brings & changes:
- Now you can listen to playback events using
stream
(a broadcast stream) insideAudioPlayer
. This was a great problem in earlier version as one always needs to trigger UI updates whenever playback progresses, ends etc. - One of the big problems in earlier version was that there was no way to detect if an audio playback has ended after completion. Resulting in issues like #25 & #26. Now
audio.isCompleted
storesbool
if an audio has ended, same can be accessed fromstream
. - Now you can provide any random
id
while creating new instance ofAudioPlayer
, this was a big problem earlier as newid
had to be consecutive to earlier one. - Now you can access same instance of
AudioPlayer
even if you make new constructor, by providing sameid
. - Now asset files can be played & loaded into
AudioPlayer
usingload
method.AudioSource
class has two static methodsAudioSource.fromFile
to load an audio file.AudioSource.fromAsset
to load an audio asset.
- Now audio field stores
Audio
object, inside the AudioPlayer class & contains following fields to get information about current playback.file
: Current loadedFile
.isPlaying
: Whether file is playing.isCompleted
: Whether file is ended playing.- By default once playback is ended,
stop
method is called &AudioPlayer
is reverted to initial configuration.
- By default once playback is ended,
isStopped
: Whether file is loaded.position
: Position of current playback inDuration
.duration
: Duration of current file inDuration
.
- Now contructor of
AudioPlayer
no longer calls async methods, which could result in false assertions. - Now
ma_resource_manager
is used fromminiaudio_engine
withMA_DATA_SOURCE_FLAG_STREAM
flag.- This will improve general performance during playback, as whole file will not be loaded into memory.
- Structure of code improved & separated into various files & classes.
- Now device handling is present in an entirely separate class
AudioDevices
. - Improvements to how methods are identified & called in method channel.
flutter_types.hpp
improves code readability. - Other bugs that randomly caused termination after false assertions are also fixed to an extent.
- Removed wave & noise APIs temporarily. Apologies to everyone & MichealReed.
NOTES
- I hurried a bit with this release at the end, so queues are still unimplemented.
- I have found a different approach for this plugin, so I'll spend time on that in future.
Thankyou everyone.