Open butlimous opened 4 years ago
facing the same problem. any solution?
var crickets = []
for(i=0;i<4;i++){
crickets.push(new Howl({
src: ["{{ url_for('static', filename='sounds/single_cricket.mp3')}}"],
volume:0.5
}))
}
$("#scatter_button").on("click",function(){
for(i=0;i<crickets.length;i++){
cricket = crickets[i]
cricket.play()
x = Math.random() * 2 - 1;
y = Math.random() * 2 - 1;
// console.log(x,y)
cricket.pos(x,y,-0.5)
}
})
I am trying to create multiple Cricket sound from a single Cricket sound source., and then positioning them randomly on the 3D sound plane. But, I can hear only one sound.
You should be able to just directly play the file again when needed even if it's already playing. You should not load it again.
Hi
I don't know if this is by design or it is a bug but I feel it does not make sense currently.
If I create a new sound object using the following code:
The first function call would fire the success event but the second one does nothing. It's just stuck without any kind of response.
I know that it does not make sense to create multiple objects on the same file but I wasn't aware of the problem because no event fired and so no error to catch and I spent some good time figuring out what is going on. So I feel this should trigger the
loaderror
event if it's something wrong to do orload
if it's ok. Thanks!