草庐IT

backgroundSound

全部标签

ios - 如何给 SpriteKit 添加背景音乐?

我试过这样做:letsoundFilePath=NSBundle.mainBundle().pathForResource("GL006_SNES_Victory_loop.aif",ofType:"GL006_SNES_Victory_loop.aif")letsoundFileURL=NSURL(fileURLWithPath:soundFilePath!)letplayer=AVAudioPlayer(contentsOfURL:soundFileURL,fileTypeHint:nil)player.numberOfLoops=-1//infiniteplayer.play()