Coder Social home page Coder Social logo

aditdiqdpratama / flutter_audio_desktop Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alexmercerind/flutter_audio_desktop

0.0 0.0 0.0 1.81 MB

[WIP] An ๐ŸŽต audio playback library for Flutter Desktop. Supports Windows & Linux. Based on miniaudio.

License: MIT License

Dart 28.86% C++ 50.16% C 3.16% CMake 17.82%

flutter_audio_desktop's Introduction

โœ’ 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

flutter_audio_desktop's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.