Contents

simulated(mesh:materials:)

A reverb that is simulated from a reverb mesh and materials.

Declaration

static func simulated(mesh: ReverbMeshResource, materials: [Audio.Material] = [.default]) -> Reverb

Parameters

  • mesh:

    The reverb mesh resource that defines the acoustic geometry of the space.

  • materials:

    An array of audio materials that define how each surface absorbs and scatters sound. Each element corresponds to a material index in the mesh. Defaults to Default.

Return Value

A reverb configured for runtime acoustic simulation.

Discussion

Use this factory method to create a reverb that ray-traces acoustic geometry at runtime, simulating how sound reflects through the space defined by the mesh:

entity.components.set(
    ReverbComponent(reverb: .simulated(mesh: roomMesh, materials: [.concrete, .carpet, .glass]))
)

As spatial audio sources move through the space, the reverb updates dynamically — reflections tighten near walls and open up in larger areas.