flutter_audio_desktop 0.1.1
flutter_audio_desktop: ^0.1.1 copied to clipboard

discontinued

An audio playback library for Flutter Desktop. Supports Windows & Linux. Based on miniaudio.

dart_vlc is sequel to this project. #

It provides better playback, format support, control & features.















Although this library still works. (But has very bad code).

Installing #

Mention in your pubspec.yaml:

dependencies:
  ...
  flutter_audio_desktop: ^0.1.0

Using #

// Create new instance.
var audioPlayer = new AudioPlayer(id: 0)
..stream.listen(
  (Audio audio) {
    // Listen to playback events.
  },
);
// Load audio source
audioPlayer.load(
  new AudioSource.fromFile(
    new File('/home/alexmercerind/music.mp3'),
  ),
);
// Start playback.
audioPlayer.play();
// Get audio duration.
audioPlayer.audio.duration;
// Change playback volume.
audioPlayer.setVolume(0.5);
// Change playback position.
audioPlayer.setPosition(Duration(seconds: 10));
// Get playback position.
audioPlayer.audio.position;
Timer(Duration(seconds: 10), () {
    // Pause playback.
    audioPlayer.pause();
}
// Few other things.
audioPlayer.audio.file;
audioPlayer.audio.isPlaying;
audioPlayer.audio.isCompleted;
audioPlayer.audio.isStopped;

Other classes & methods are documented in their docstrings very well.

See this example for a better overview.

Windows

Linux

Support #

If you want to be kind to me, then consider buying me a coffee.

Thankyou!

Progress #

PlatformStatus
LinuxWorking
Microsoft WindowsWorking
MacOSLearn More

License #

I don't want to put any restrictions on how you distribute your Flutter Desktop apps, so this library comes under very permissive software, MIT license.

Since, other libraries like libvlcpp or libvlc come under GPL & LGPL licenses respectively, so there will be many restrictions if I plan to use them.

Thus, this project uses miniaudio and miniaudio_engine from David Reid under MIT license.

Acknowledgments #

22
likes
0
pub points
73%
popularity

Suggested replacement

dart_vlc

An audio playback library for Flutter Desktop. Supports Windows & Linux. Based on miniaudio.

Repository (GitHub)
View/report issues

Documentation

Documentation
API reference

Uploader

saini123hitesh@gmail.com

License

LICENSE

Dependencies

flutter, path, path_provider

More

Packages that depend on flutter_audio_desktop