Skip to content

Latest commit

 

History

History
96 lines (67 loc) · 1.41 KB

README.md

File metadata and controls

96 lines (67 loc) · 1.41 KB

Metronome

pub package

Efficient, accurate, cross-platform metronome; supports volume, BPM, and audio source settings.

Metronome

TODO

  • Add support for time signature #2
  • Add Windows support
  • Add CallBack function on Tick for web

Quick Start

Init

final metronome = Metronome();
metronome.init('
    assets/audio/snare.wav', 
    bpm: 120, 
    volume: 50,  
    //When set to true, the music of other apps will stop when the metronome is played. 
    enableSession: true,
    enableTickCallback: true,
);

Play

metronome.play();

Pause

metronome.pause();

Stop

metronome.stop();

Volume

metronome.getVolume();
metronome.setVolume(50);

BPM

metronome.setBPM(120); 
metronome.getBPM(); 

get Play state

metronome.isPlaying();

setAudioFile

metronome.setAudioFile('assets/audio/snare.wav');

destroy

metronome.destroy();

Tick callback

metronome.onListenTick((_) {
    print('tick');
});

About Web

Please add the example/web/app.js file to index.html under your web. As follows:

<script src="app.js" defer></script>