in the gameScene.swift:
declaration:
var backgroundMusic: SKAudioNode!
in didMoveToView:
if let musicURL = NSBundle.mainBundle().URLForResource("Jalandhar", withExtension: "mp3") {
backgroundMusic = SKAudioNode(URL: musicURL)
addChild(backgroundMusic)
}
i ended up using AVAudioPlayer to workaround it , code may be useful:
declare as property :
then in a function :