Play Sound in Swift SpriteKit project?

后端 未结 2 1984
悲&欢浪女
悲&欢浪女 2021-01-13 02:19

When I run this code.

runAction(SKAction.playSoundFileNamed(\"Click.mp3\", waitForCompletion: false))

My app was Crashed:

2条回答
  •  一生所求
    2021-01-13 02:40

    I had this exact problem for the last hour! I had to go a different route, because I tried multiple things to get this simple line of code to work and failed. It's a little more code, but this solved my problem: https://stackoverflow.com/a/24073071/586204.

提交回复
热议问题