Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I want to create custom player with 10 sounds for example. All 10 tracks are components of one music composition, created by different instruments.

For each track I want to have on/off switcher. After clicking each switcher sounds will play.

After turning on of all buttons all tracks have to be played in the same time.

Each track have to be repeated again and again after finishing. Is it possible to make this without flash?

This is example of this task, created in ActionScripts: http://www.incredibox.com/en/play#

Thanks!

share|improve this question

2 Answers

It is possible with HTML5 Audio API.

See this getting started tutorial: http://www.html5rocks.com/en/tutorials/webaudio/intro/

Here is an excellent library to start with: http://www.createjs.com

and some examples: http://www.createjs.com/#!/SoundJS/demos

as well as the official spec: https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html

share|improve this answer

Using the HTML5 javascript audio API, you can instantiate as many audio objects as you like:

var soundOne = new Audio('sound1.ogg'),
    soundTwo = new Audio('sound2.ogg'),
  soundThree = new Audio('sound3.ogg');
// etc.

You can then play and stop them programatically. E.g. soundOne.play();

Check out https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio

For looping, there is a loop directive, but it's not widely supported. Check out this SO article for a work around: HTML 5 Audio Looping

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.