Add Background Music
The SKAudioNode class is a subclass of SKNode. With this class, you can build a robust audio node capable of 3D spatial audio effects, independent volume control, stereo balance, and special effects like speeding up or slowing down the playback rate. With these added capabilities, you can create some interesting effects like adjusting the playback of a car’s engine roar as it goes faster and slower.
When you add an audio node directly to the scene, or as a child on another node, you’re able to run sound-related actions on that node such as play(), pause(), and stop(). You can also run the following actions to modify some of the audio node’s key properties:
If you look closely, you’ll notice a pattern here: the actions ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access