Very good library!! I appreciate too much your work!
That is my question, or my issue better: i need to play several files.. one after other and other .. until the end, I have the name of the files dynamically .. so they are not like fixed names like the example of the included instructions ..
In the instructions included the code is like :
//Load the sounds
sounds.load([
"sounds/shoot.wav",
"sounds/music.wav",
"sounds/bounce.mp3"
]);
but I would to load them from a json string. Like this:
{"sounds": [{"id": 1,"filename": "demo.mp3"},{"id": 2,"filename": "oly.mp3"}]}
I code the following lines but those works just with one or two files
bs_resultado().each(function (r) {
if (r.id > 1) {
var filenamesound = "sounds/files/" + r.filename;
sounds.load([ filenamesound ]);
}
});
is available any instructions to avoid one file will be played before the other one has finished ? because when i play them ..
bs_resultado().each(function (r) {
if (r.id > 1) {
var filenamesound = "sounds/files/" + r.filename;
var music = sounds[filenamesound ];
music.setEcho(echoparam1, echoparam2, 1000);
music.playbackRate = playbackrate;
music.play();
}
});
Hello!
This library doesn't currently support what you are trying to do - there is no onComplete callback, for example.
You might want to try Howler.js: https://howlerjs.com
Hello!!
Very good library!! I appreciate too much your work!
That is my question, or my issue better: i need to play several files.. one after other and other .. until the end, I have the name of the files dynamically .. so they are not like fixed names like the example of the included instructions ..
In the instructions included the code is like : //Load the sounds sounds.load([ "sounds/shoot.wav", "sounds/music.wav", "sounds/bounce.mp3" ]);
but I would to load them from a json string. Like this: {"sounds": [{"id": 1,"filename": "demo.mp3"},{"id": 2,"filename": "oly.mp3"}]}
I code the following lines but those works just with one or two files
bs_resultado().each(function (r) { if (r.id > 1) { var filenamesound = "sounds/files/" + r.filename; sounds.load([ filenamesound ]);
});
is available any instructions to avoid one file will be played before the other one has finished ? because when i play them ..
.. they mix, do not sound one after another
Give me your hand! Regards!