I want to play RealityKitContent USDA model's Spatial Audio, I use this code:
RealityView{ content in
do {
let entity = try await Entity(named: "isWateringBasin", in: RealityKitContent.realityKitContentBundle)
let audio = entity.spatialAudio
entity.playAudio(audio)
content.add(entity)
} catch {
print("Entity encountered an error while loading the model.")
return
}
}
entity.playAudio(audio)
this code need add a 'AudioResource'
back of audio
, Excuse me, what should AudioResource
be?