playSoundFileNamed(_:waitForCompletion:)
Creates an action that plays a sound.
Declaration
class func playSoundFileNamed(_ soundFile: String, waitForCompletion wait: Bool) -> SKActionParameters
Return Value
A new action object.
Discussion
Use SKAction playSoundFileNamed:waitForCompletion: only for short incidentals. Use AVAudioPlayer for long running background music. This action is not reversible; the reversed action is identical to the original action.
See Also
Controlling the Audio of a Node
play()pause()stop()changePlaybackRate(to:duration:)changePlaybackRate(by:duration:)changeVolume(to:duration:)changeVolume(by:duration:)changeObstruction(to:duration:)changeObstruction(by:duration:)changeOcclusion(to:duration:)changeOcclusion(by:duration:)changeReverb(to:duration:)changeReverb(by:duration:)stereoPan(to:duration:)stereoPan(by:duration:)