audioclip

0.2.0 • Public • Published

Audioclip

Easily load and play (over and over again if you like) all or part of short(ish) audio files in the browser.

Uses the Web Audio API when available (which supports precise play length and multiple instances of the same sound playing at once), otherwise falls back to HTML5 <audio> tags. If those aren't available either (Internet Explorer 8 and below, basically), a graceful degradation to silence occurs.

API

var clip = new AudioClip(url); // Load the clip
 
clip.play(); // Play entire clip
 
clip.play(start_time_in_seconds);  // Play clip from start time to end
 
clip.play(start_time_in_seconds, duration_in_seconds); // Play clip from start time to start time + duration

Licence

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i audioclip

Weekly Downloads

1

Version

0.2.0

License

MIT

Last publish

Collaborators

  • scottglz