SKAudioNode stereoPan not working

Hello,

i am facing problem with changing stereoPan while i am using SKAudioNode to play sound.

Audio keeps playing always on both channels.

Code i wrote:


let audioNode = SKAudioNode.init(fileNamed: "sfx_dog2") 
audioNode.autoplayLooped = false 
self.addChild(audioNode) 
let pan = SKAction.stereoPan(to: -1.0, duration: 1) 
audioNode.run(SKAction.sequence([SKAction.play(),pan]))


i also tried different combinations of calling it and -100 to 100 range as well with no effect.

I also double checked audio file, it is stereo.

I need to use it as SKAction because i queue multiple actions.

Replies

Have you tried using an SKAction.group instead of an SKAction.sequence? Maybe the sound stops playing before the pan happens since those two actions are in a sequence. If you put them in a group they will start at the same time, otherwise you would never hear the effects of the pan assuming the sound being played has completed before the pan action starts.

It's not working as well 😟 Same as before, i hear sound in both channels.

Can someone confirm this error ? Or provide sample code ?

I didn't find any extra requirements in documentation.