One Logo Pool Ball
RealityFoundation · IOS API REFERENCE

AudioFileGroupResource

class · iOS 18.0+ · SDK 27.1

@MainActor @preconcurrency class AudioFileGroupResource

An audio file group.

Members (4)

static · iOS 18.0+

load

TypeScript
static load(name: string, scene: string, bundle?: (_Foundation_Bundle) | null): Promise<AudioFileGroupResource>
Swift declaration
@MainActor @preconcurrency static func load(named name: String, from scene: String, in bundle: Bundle? = nil) throws -> AudioFileGroupResource

Loads an audio resource from a Reality Composer Pro project. This method loads a preconfigured ``RealityKit/AudioFileGroupResource`` from a scene in a Reality Composer Pro project. - Important: The name provided **must** be unique. - Parameters: - name: The USD Prim path to the resource in the Reality Composer Pro project to load. - scene: The name of the Reality Composer Pro scene to load from. - bundle: The bundle that contains the project. Leave `nil` to load from the app's bundle.

init · iOS 18.0+

init

TypeScript
static initNamedFromIn(name: string, scene: string, bundle: _Foundation_Bundle): Promise<AudioFileGroupResource>
Swift declaration
@MainActor @preconcurrency convenience init(named name: String, from scene: String, in bundle: Bundle) async throws

Initializes an audio resource from a Reality Composer Pro project. This method initializes a preconfigured ``AudioFileGroupResource`` from a scene in a Reality Composer Pro project. - Important: The name provided **must** be unique. - Parameters: - name: The USD Prim path to the resource in the Reality Composer Pro project to initialize. - scene: The name of the Reality Composer Pro scene to initialize from. - bundle: The bundle that contains the project.

get · iOS 18.0+

resources

TypeScript
get resources(): Promise<Array<AudioFileResource>>
Swift declaration
@MainActor @preconcurrency final let resources: [AudioFileResource]

The `AudioFileResource` objects which comprise this `AudioFileGroupResource`.

init · iOS 18.0+

init

TypeScript
static init(resources: Array<AudioFileResource>): Promise<AudioFileGroupResource>
Swift declaration
@MainActor @preconcurrency init(_ resources: [AudioFileResource]) throws

Creates a group resource from an array of audio file resources (backward compatibility). This initializer maintains backward compatibility with existing code that doesn't specify configuration. - Parameter resources: The audio file resources for the group - Throws: An error if the provided array is empty or if the underlying audio assets do not have matching channel layouts.

Skipped declarations

No declarations were skipped in this snapshot.

All RealityFoundation types →