Mihai Fratu
Mihai Fratu

Reputation: 7663

SCNAudioPlayer's audioNode property missing

So, I'm trying to build a little game using Apple's SceneKit and as with all games I need to add some sounds here and there.

Reading trough the documentation the SCNAudioPlayer could help with that and it's audioNode property would allow me to change the volume of a sound, reverb, etc.

Now, the thing is that even though the documentation clearly states that there's this audioNode property on the SCNAudioPlayer class, and even though this property appears in the headers of the framework, be it Objective-C:

enter image description here

or Swift:

enter image description here

when I try to use it in my code I get this error:

enter image description here

Any idea what I'm doing wrong?

Upvotes: 1

Views: 174

Answers (1)

Mihai Fratu
Mihai Fratu

Reputation: 7663

Ok.

After struggling with this more then 3 hours and posting my question here I've managed to find that the problem was that I was not importing the AVFoundation framework which is needed so that the audioNode property would be exposed.

So a simple

import AVFoundation

Did the trick.

Thanks!

Upvotes: 1

Related Questions