Skip to content

hyamamoto/dancer.dart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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+4 (3/1/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 'tonetext.ogg'
  dancer.load({ "src": "../songs/tonetest", "codecs": [ "ogg"]});

  ...
  ...
  ...

  // Start playing  
  dancer.play();

Dependencies

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

Change Logs

** 0.4.0+4 (3/1/2014) **

  • Dependency fix (newly released 'browser =0.10.0' is still buggy.)
  • Updated all examples.

** 0.4.0 (2/28/2014)**

  • Complete wrapper of dancer.js v0.4.0.

License

dancer.dart is released under the the MIT license by Hiroshi Yamamoto higon@freepress.jp

About

High-level sound / audio API for HTML 5 with Flash fallback. This 'dancer.js' wrapper is written in Dart language.

Resources

License

Stars

Watchers

Forks

Packages

No packages published