How do i change the duration of a created sound created with SKAction.playSoundFileNamed
:
var sound = SKAction.playSoundFileNamed("sound.mp3", waitForCompletion: false)
I tried setting sound.duration = 1.0
but with no luck so far ?
In short, that is impossible with SKAction.playSoundFileNamed: method.
duration property specifies the time in seconds required for current action to complete.
When using SKAction.playSoundFileNamed: method you don't have control over the audio being played (no pausing, stoping, resuming pitching etc). It's meant to play a sound, nothing more.
Some useful links: