Graph Configuration: Context, Connection, and Playback Control
This example demonstrates how to initialize an audio graph, load a source from disk, connect it to the destination, and control its playback. It illustrates the flow of configuration, execution, and resource teardown within the environment, highlighting the model’s simplicity and precision.
// Configure the graph for renderinglet context =Assembler(rendering: .live).createAudioGraph()// Configure an audio source (Renderer) from a local audio filelet url =URL(fileURLWithPath:"/path/to/audio.wav")let source =FileRenderer(contentsOf: url)// Configure node connectionstry context.connect(source: source, to: context.destination)source.play(after:0)
The following video shows the sample code in action and its real-time processing.
Control and Finalization
This example demonstrates how to stop playback, terminate active rendering, and disconnect nodes from the graph. It illustrates the control, shutdown, and resource-release flow within the audio environment, highlighting the model’s clarity and precision.
For a complete description of each class, method, and property referenced in this section, refer to the official API documentation, where you will find detailed references, available components, parameters, and additional usage code examples.