ios - Why is there a lag in my game everytime my sound is being played in swift? -


the sound plays everytime tap screen there slight hiccup in game see lag screen. how fix this?

class level1: skscene, skphysicscontactdelegate, gkgamecentercontrollerdelegate {      var jumpsound = nsurl(fileurlwithpath: nsbundle.mainbundle().pathforresource("tapsound", oftype: "wav")!)      var jumpaudioplayer = avaudioplayer()       override func didmovetoview(view: skview) {      jumpaudioplayer = avaudioplayer(contentsofurl: jumpsound, error: nil)     jumpaudioplayer.preparetoplay()        }        override func touchesbegan(touches: set<nsobject>, withevent event: uievent) {      thehero.physicsbody?.applyimpulse(cgvector(dx: 0, dy: 200))     jumpaudioplayer.play()      }       } 

lower quality/bitrate of audio play.


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

php - Find a regex to take part of Email -