dancer.dart

A Dart package "dancer" is a high level audio library for HTML5 with a Flash fallback. It is implemented as a dancer.js wrapper.

version 0.4.0 (2/28/2014)

Features

  • Use real-time audio waveform and frequency data and map it to any arbitrary visualization
  • Use Dancer to get audio data from any preexisting audio source
  • Leverage kick detection into your visualizations
  • Simple API to time callbacks and events to any section of a song
  • Supports Web Audio (webkit/mozilla), Audio Data (mozilla) and flash fallback (v9+)
  • Extensible framework supporting plugins and custom behaviours

Live Examples

API Document

Code Example


  final Dancer dancer = new Dancer();

  // Setup a kick detection.
  int kickCount = 0;
  final Kick kick = dancer.createKick(new KickOptions()
    ..decay = 0.02
    ..threshold = 0.3
    ..onKick = (num mag) { print( 'Kick[$kickCount]: mag = $mag'); kickCount++; }
    ..offKick = null
  ).on();

  // Schedule time based functions.
  dancer.onceAt( 1, () {
    print("Scheduled Func: 1 sec");
  }).between( 1.5, 2.0, () {
    print("Scheduled Func: 1.5 sec - 2.0 sec");
  }).onceAt( 2.5, (){
    final num freq = dancer.getFrequency( 400);
    print("Scheduled Func: 2.5 sec: $freq");
  }).after( 4, () {
    final num time = dancer.getTime();
    print("Scheduled Func: 4 sec +: $time");
    //kick.off();
  });

  // Load up an audio file.
  dancer.load({ "src": "../songs/tonetest", "codecs": [ "ogg", "mp3"]});

  ...
  ...
  ...

  // Start playing  
  dancer.play();

Dependencies

  • dancer.js - a backend javascript implementation (included inside a 'packages/dancer' directory).

Change Logs

0.4.0 (2/28/2014) * Complete wrapper of dancer.js v0.4.0.

0.0.1 (2/27/2014) * Prottype based on dancer.js v0.0.1

License

dancer.dart is released under the the MIT license by Hiroshi Yamamoto <[email protected]>

Libraries

dancer

A high level audio API for HTML5 with a Flash fallback. (dancer.js wrapper)