Hello all, this has been puzzling me for a good few hours now.
My config is a SwiftUI view from where I am calling a UIViewRepresentable that makes up my ARView. The representable is passed a delegate and an ARView instance
RealityKitView(arView: $arView, sceneDelegate: $delegate)
I have set up a delegate for my ARView like so:
class MySessionDelegate: NSObject, ARSessionDelegate, ARSessionObserver {
var bufferArray: [CMSampleBuffer] = []
func session(
_ session: ARSession,
didOutputAudioSampleBuffer audioSampleBuffer: CMSampleBuffer
){
bufferArray.append(audioSampleBuffer)
}
}
and of course I set audio samples to be provided with
config.providesAudioData = true
in the makeUIView function.
But for some reason I don't get more than 125 samples. I set up a counter in the session function to see how many samples I get and it always just stops at 124..I have no idea why this is happening. I also tested on different devices (iPad Pro from 2021 and iPhone 11) and it always stops at 124 samples and then just doesn't do anything anymore...what the hell? :D
Do I need to do anything special when linking the delegate to my arview? I am just doing session.delegate = delegate
in the makeUIView function
Any and all help would be greatly appreciated!