Regulating the volume of SKAction playSoundFileNamed:

前端 未结 3 1161
心在旅途
心在旅途 2021-02-13 12:05

Is there a way to regulate the volume of sound played via SKAction playSoundFileNamed:waitForCompletion:.

I would like to implement a simple music & sound effects sl

3条回答
  •  执笔经年
    2021-02-13 12:42

    Unfortunately you can't modify the volume using SKAction, so you have to use AVAudioPlayer for your effects too. You could implement a custom playSoundFileNamed:waitForCompletion:volume: using runBlock as you already thought, so your code won't be very different then using playSoundFileNamed:waitForCompletion:.

提交回复
热议问题