Code Monkey home page Code Monkey logo

flutter_audio_desktop's Introduction

flutter_audio_desktop

A simple yet functional ๐ŸŽต audio library for Flutter Desktop.

Likes Score

Right now, as it is just a start, it supports MP3, WAV & FLAC playback. I'll try to increase the domain of support formats with time & plan is to provide metadata of a track aswell.

Feel free to open issue anytime.

โฌ‡๏ธ Install

Mention in your pubspec.yaml requirements:

dependencies:
  ...
  flutter_audio_desktop: ^0.0.6

๐Ÿ“ Usage

// Start AudioPlayer.
var audioPlayer = new AudioPlayer();

// Load audio file.
audioPlayer.load('/home/alexmercerind/music.mp3');

// Start playing loaded audio file.
audioPlayer.play();

// Get audio duration.
print('Duration Of Track: ${audioPlayer.getDuration()}');

// Change playback volume.
audioPlayer.setVolume(0.5);
print('Changed volume to 50%.');

// Change playback position.
audioPlayer.setPosition(Duration(seconds: 10));

// Get playback position.
print('Position of playback after skipping 10 seconds: ${audioPlayer.getPosition()}');

Timer(Duration(seconds: 10), () {

    // Pause the playback.
    audioPlayer.pause();
    print('Playback of audio stopped after 10 seconds.');
}

You can see this simple example app, if you are confused with the usage.

โค๏ธ Like the library?

Feel free to use in your Flutter Desktop app. Consider โญ starring the repository if you want to show YOUR SUPPORT to the development & appreciate the effort.

โœ”๏ธ Progress

The library is supported on Microsoft Windows & Linux.

Platform Status
Microsoft Windows Working
Linux Working
MacOS Not Working

๐Ÿ”ง How It Works ?

One word, C++. It calls native methods using dart's MethodChannel. It uses miniaudio from David Reid.

I wrote this simple wrapper in C++ around his library to get this working.

There is not any audio playback library for Flutter Desktop at the moment, so I decided to write one myself.

๐Ÿ’Œ Thanks to David Reid.

flutter_audio_desktop's People

Contributors

alexmercerind avatar

Watchers

 avatar  avatar

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.