You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Players.onload callback doesn't seem to be invoked if the Players object is constructed with more than one audio file / buffer.
To Reproduce
The code snippet below is taken from Players.test.ts.
I imagine that if you added a second item to the url audio buffer map and ran the test, that the onload callback would not fire & the test would fail.
it("can pass in additional args in the second parameters", (done) => {
const players = new Players({
test: "./audio/sine.wav",
}, {
onload: () => {
expect(players.player("test").buffer.loaded).to.be.true;
expect(players.volume.value).to.be.closeTo(-12, 0.1);
players.dispose();
done();
},
volume: -12,
});
});
Expected behavior
I expected the onload callback to be fired when both/all buffers have been loaded.
What I've tried
With just one item in the map, I verified that the onload callback fires. With more than one, it doesn't seem to work. In my personal code, I even replaced the audio file of the second player to be the same audio file as the first player, and the onload callback never fired.
const audioSamples = new Tone.Players({
sampleA: "assets/some_valid_url.m4a",
sampleB: "assets/some_valid_url.m4a", // `onload` never called even if I use the same file!
}, {
onload: () => {
// this line never seems to fire.
console.log('loaded audio');
},
onerror: (e) => {
console.log('players error ', e);
},
});
The text was updated successfully, but these errors were encountered:
Describe the bug
Players.onload callback doesn't seem to be invoked if the Players object is constructed with more than one audio file / buffer.
To Reproduce
The code snippet below is taken from Players.test.ts.
I imagine that if you added a second item to the url audio buffer map and ran the test, that the
onload
callback would not fire & the test would fail.Expected behavior
I expected the onload callback to be fired when both/all buffers have been loaded.
What I've tried
With just one item in the map, I verified that the
onload
callback fires. With more than one, it doesn't seem to work. In my personal code, I even replaced the audio file of the second player to be the same audio file as the first player, and theonload
callback never fired.The text was updated successfully, but these errors were encountered: