Positional Audio in SceneKit / ARKit with AudioKit

I studied positional sound in the Scene Kit / ARKit and would like to know if AudioKit can be used in this context to benefit from its higher level instruments for analysis, sound generation, effects, etc.

For some background, SCNView comes with AVAudioEnvironmentNode, AVAudioEngine and audioListener (SCNNode). These properties are initialized, and the node environment is already configured on the engine. The positional sound source is added to the scene via SCNAudioPlayer, which can be initialized using AVAudioNode - AVAudioNode must be connected to the node environment and have a monaural output.

SCNAudioPlayer is then added to the SCNNode in the scene and automatically takes care of changing the output of the AVAudioNode according to its position in the scene, as well as the position and orientation of the audioListener node.

I hope that it will be possible to initialize AudioKit using the AVAudioEngine SCNView property, configure the SCNViews node environment in the graph of the node engines, use the AVAudioNode property for AKNodes to initialize SCNAudioPlayers, and ensure all sources are connected correctly to the node environment. Ive already started changing the source code of AudioKit, but I don’t understand what classes I will need to adapt and how to integrate the node environment into the AudioKit pipeline. In particular, I am having trouble understanding connectionPoints and the outputNode property.

Does anyone think this might not be possible, given how AudioKit is structured or has any pointers to the approach?

Of course, I will be happy to share any of my findings.

+4
source share
1 answer

AudioKit creates its own instance of AVAudioEngine in line 38 of AudioKit.swift:

https://github.com/AudioKit/AudioKit/blob/master/AudioKit/Common/Internals/AudioKit.swift#L38

but it’s open, so you can overwrite it with the SceneView sound engine. I do not see anything that could prevent this.

+1
source

Source: https://habr.com/ru/post/1688632/


All Articles