It seems like the issues is with this line:
audioEngine.connect(audioPlayerNode, to: audioEngine.mainMixerNode, format: nil)
For some reason, if I specifically set the format to be the format of the PCM buffer, then the memory leak issue is gone.
Post
Replies
Boosts
Views
Activity
Typo there, the rate is 48000(aka 48kHz).
Hi @Vision Pro Engineer
Thanks for the info. I have an app on the app store that allows users to create and share spatial content, and one of which is 3D model.
Currently I'm using a RealityView wrapped in a Volumetric Window to display 3D models in the user's space, scaled and repositioned in the centre of the volume according to their bounding boxes. However, there are a few limitations, such as:
For animated models, the animation might cause the model to go out of the bounds of the volume.
Window management issues, e.g. when the user opens a volumetric window, and closes the app in the order of closing the main window first and then closing the volumetric window, when they reopens the app, it's always shows the volumetric window and they'll never be able to open the main window again(unless add additional logic).
I'm now migrating the app to set visionOS 2.0 as the minimum deployment target. And the Quicklook preview application has many nice built-in features, such as snapping to surface, free scaling, gesture handling, etc.
You can directly load the scene using a URL, no need to set up model:
let scene = try SCNScene(url: url)
let renderer = SCNRenderer(device:MTLCreateSystemDefaultDevice())
renderer.scene = scene
let image = renderer.snapshot(atTime: 0, with: AppStyle.ImageSize.thumbnail.size, antialiasingMode: .multisampling4X)
Meanwhile, as for now, the QuickLookThumbnailing framework can't generate thumbnails for usdz files on visionOS, we should wait for it to be available.
TLDR, no need to manage provisioning profile:
Share your project folder with the virtual machine
Open the project in xcode 15.4 in the virtual machine, do not change anything
Click Product->Archive
Once done, copy the archive to your physical machine
Open the project in your physical machine, and click Window->Organizer, and distribute your app.
If your project doesn't require additional build configurations, you can also use xcode cloud build to simplifiy things.