How can I play sequential sounds in nodejs

0

I have a function that is as follows:

function reproduciraudio(archivo) {

    child = exec('nohup  mplayer ./voces/'+archivo,
    function (error, stdout, stderr) {

        if (error !== null) {
            console.log('exec error: ' + error);
        }
        console.log("finalice")
    });
}; 

and every time I call it in my code, they run in parallel, that is, several audios sound at the same time I would like to see a way that when you call this function with a sound as a parameter, it is added to the playback queue and that after finishing the sound that is sounding at that moment the other begins, not all at once

    
asked by Pedro Rivera 11.04.2018 в 00:13
source

0 answers