Recording (Bounce)

How to bounce from an source into a stereo file in offline mode

This example demonstrates how to record and generate a final mixdown using the offline rendering mode. The flow plays a source from file, routes it through a Recorder node, and captures the processed audio signal in real time, producing a stereo output file.

// Configure the graph for rendering
let context = Assembler(rendering: .offline).createAudioGraph()

// Configure an audio source (Renderer) from a local audio file
let url = URL(fileURLWithPath: "/path/to/source.mp3")
let source = FileRenderer(contentsOf: url)

// Configure the intermediate stereo recording node
let destination = Recorder(channels: .stereo)
context.addAutomaticPullNode(node: destination)

// Configure node connections
try context.connect(source: source, to: destination)
source.play(after: 0)

// Start recording
destination.record()
context.startOfflineRendering()

The following video shows the sample code in action and its real-time processing.

circle-info

For a complete description of each class, method, and property referenced in this section, refer to the official API documentationarrow-up-right, where you will find detailed references, available components, parameters, and additional usage code examples.

Last updated