Audio.Material
A type that describes the acoustic characteristics of a surface.
Declaration
struct MaterialOverview
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
}