Kelin Sasha
Kelin Sasha

Reputation: 187

SCNAudioSource isn't positional

My game can play sound successfully now by using the SCNAudioSource and SCNAction. For example:

let audioSource1 = SCNAudioSource(fileNamed: "Fire.mp3")!
audioSource1.isPositional = true
let play = SCNAction.playAudio(audioSource1, waitForCompletion: false)
audioNode.runAction(play)

But it seems that the isPositional attribute doesn't work at all, even after I artificially set the camera as the SCNView's audioListener.

I guess that the problem has something to do with the scale. For example, the volume of a sound will diminish 0.1 dB per meter. But since my game objects are so small and the camera moves so slowly, I cannot observe any distinct change of the volume by moving the camera away from the sound source. Is this correct?

How can I fix this problem?

SOS

Upvotes: 2

Views: 432

Answers (1)

Kelin Sasha
Kelin Sasha

Reputation: 187

Converting my files mono solves the problem.

Upvotes: 1

Related Questions