Stereo Spatialization
How to distribute the signal across channels with stereo spatialization
// Configure the graph for rendering
let context = Assembler(rendering: .live).createAudioGraph()
// Configure an audio source (Renderer) from a local audio file
let url = URL(fileURLWithPath: "/path/to/source.wav")
let source = FileRenderer(contentsOf: url)
// Configure a stereo spatializer with pan shifted to the left
let destination = StereoSpatializer(pan: -1.0)
// Configure node connections
try context.connect(source: source, to: destination)
try context.connect(source: destination, to: context.destination)
source.play(after: 0)Last updated