I have a sound file I wish to loop like the engine of a vehicle. The sound I have is 1 second long and it is a .wav file. I'm quite certain the file is cut to be seamless, it loops perfectly in Audacity.
I'm calling the sound with this code:
let playEngineSound = SKAction.playSoundFileNamed("engine.wav", waitForCompletion: true)
let engineSoundLoop = SKAction.repeatActionForever(playEngineSound)
self.runAction(EngineSoundLoop, withKey: "engine sound")
I use "withKey" to be able to cancel it later. The Sound comes out fine but there is a small but distinctive hiccup where the sound seems to be reloading or waiting for the other to stop completely before starting the new loop.
Any help would be much appreciated!
Aucun commentaire:
Enregistrer un commentaire