+ 1
Audio causes lagg
Hi! I have finally been able to get audio playing as I want! However every time audio is played, the game laggs a little bit. I load all the audio upon starting the game. Anyone know how to get rid of this lagg? Here is the code: https://code.sololearn.com/WkIPQwthB6K9/?ref=app To remove flap audio (and lagg), comment out line 177 “flapp();” Thanks! Joakim
11 odpowiedzi
+ 1
I managed to fix it!! HTML5 Audio is very bad for my purpose. There is actually a part in ThreeJS that is made for playing audio like this. This removed all the lagg! See code for how it is implemented😄
+ 4
iphone 6s+ no lag here. Just an amazing code👍
+ 3
It doesn’t lag on my iPad. Strange!
+ 3
xp nvdo Sweet! Thanks a lot 😊
+ 3
saantonandre Hey man! You are good with sounds and stuff, do you have any idea?🤔
+ 3
Joakim Nyland just tried this on my devices, on my samsung tab the sound only plays on the first tap then every other tap gives this error and plays no sound.
uncaught (in promise)DataCloneError: Cannot decode detached ArrayBuffer Line:37297.
ios works great still. sounds all play with no lag, and no error.
+ 3
Wonderful!
+ 2
More information: I have an fps of about 58, but when “flap” audio plays, fps drops by 10-26 which causes the tiny lagg.. No one knows anything about this?
+ 2
Ahmed Mokhles Thanks a lot!😄😄
+ 1
Rowsej I guess iPads are a lot faster. Thanks for checking! Can someone else check on an iPhone if it laggs a little?
+ 1
xp nvdo Thanks for the feedback! I will look into it!