T
T
tytkawa2014-10-22 14:06:48
HTML
tytkawa, 2014-10-22 14:06:48

How to consistently play sounds on the site?

there is a layout like this:

<audio reload="auto" controls>
            <source src="audio/1.mp3" >
        </audio>
        <audio reload="auto" controls>
            <source src="audio/2.mp3" >
        </audio>
        <audio reload="auto" controls>
            <source src="audio/3.mp3" >
        </audio>
        <audio reload="auto" controls>
            <source src="audio/4.mp3" >
        </audio>

You need to play sounds sequentially in turn

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis Ineshin, 2014-10-22
@tytkawa

We do it in JS, something like this:

var sound = new Audio();
            sound.src = "sound_1.mp3";
            sound.load();
            sound.addEventListener("ended", callback, false);

            sound.play();

In the callback on "ended" we start a new sound, and so on.

U
UbuRus, 2014-10-22
@UbuRus

https://stackoverflow.com/questions/16126471/how-t...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question