Skip to content
This repository has been archived by the owner on Sep 13, 2021. It is now read-only.

[WIP] An 🎵 audio playback library for Flutter Desktop. Supports Windows & Linux. Based on miniaudio.

License

Notifications You must be signed in to change notification settings

alexmercerind/flutter_audio_desktop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

✒ libwinmedia is sequel to this project.

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















An audio playback library for Flutter Desktop.

Feel free to open issue anytime.

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

Platform Status
Linux Working
Microsoft Windows Working
MacOS Learn 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