SpriteKit offers two ways to play audio:
SKAction.playSoundFileNamed:waitForCompletion
: for playing a sound onceSKAudioNode
(since iOS 9): for playing background music in a loop, or do other advanced audio stuff like positional audio (3D spatial audio effects).
The first option is quite unflexible. It just plays the sound once. You cannot change the volume or put any effects on them. SKAudioNode
on the other hand offers a lot of cool features via SKAction
s like changing the playback rate and volume and adding live effects like reverb.
This seems to be a no-brainer. I tried it in my game Fusionate and there was a real bad whistling sound, although I didn’t use any effect or positional audio (just volume changes). So, back to the first option and create a lot of audio files by hand, in order to get the desired effect even for simple things like changing the volume?
No way…