Skip to content

Easily load and play all or part of short audio files in the browser

Notifications You must be signed in to change notification settings

scottglz/audioclip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Easily load and play all or part of short audio files in the browser

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published