I'm developing a SpriteKit
game, and I encountered a problem: The SKAudioNode
instance only plays my game's background music in mono mode.
I have the following instance in my SKScene
class:
var backgroundMusic : SKAudioNode?
The following method loads and plays the background music:
func loadAndPlayBackgroundMusic() {
if let musicURL = Bundle.main.url(forResource: "music", withExtension: "mp3") {
backgroundMusic = SKAudioNode(url: musicURL)
self.addChild(self.backgroundMusic!)
} else {
print("Error: Could not load the music!")
}
}
It plays the music just fine, the only problem is that it seems to be mono (or using some sort of 3D spatial audio effect). How can I fix it?
I already trying setting the SKAudioNode's
isPositional
property to false
with no avail.