Contents

Audio.Material

A type that describes the acoustic characteristics of a surface.

Declaration

struct Material

Overview

An audio material defines how a surface absorbs and scatters sound energy across frequency bands. Use preset materials for common real-world surfaces, or create custom materials from raw absorption and scattering coefficients.

// Use a preset material:
let walls: Audio.Material = .concrete

// Create a custom material:
let custom = Audio.Material(
    absorption: .init([0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10]),
    scattering: .init([0.10, 0.09, 0.08, 0.07, 0.06, 0.05, 0.04, 0.03, 0.02, 0.01])
)

// Modify a preset material:
let thickCarpet: Audio.Material = .carpet.scalingAbsorption { frequency in
    frequency > 1000 ? 0.5 : .zero
}

Topics

Creating a material

Using hard surface materials

Using soft furnishing materials

Using natural surface materials

Adjusting acoustic properties

Instance Properties

Instance Methods

Type Properties

See Also

Defining acoustic properties