T
T
ta42014-04-12 02:36:28
JavaScript
ta4, 2014-04-12 02:36:28

Seamless transitions between audio files

There is an array of Audio objects
filled with something like this:

var buffer = new Array();
        myAudio = new Audio('/playlist/radio');
        buffer[last_part_index] = myAudio;

I reproduce next:
function work()
    {
        myAudio = buffer[current_part_index];
        myAudio.addEventListener('ended', function () {
            current_part_index++;
            work();
        });
        myAudio.play();
    }

as you can see, I play the audio data from the array in order. So the problem is that there is a small "gap" while the next element of the array starts playing. Those. visible transitions. Is it possible to somehow get around them so that the playback seems to be coherent?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2014-04-12
Protko @Fesor

www.html5rocks.com/en/tutorials/webaudio/intro/#to...
this is of course not quite right, crossfade is described here, but the essence should be clear.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question