Skip to main content

Offline Rendering

About Offline Rendering

Offline rendering, also known as offline bouncing or exporting, is a process in audio programming where an audio recording or project is processed and rendered to a new audio file. This process can be done outside of real-time playback, which allows for more processing power and time to be devoted to rendering the audio.

Offline rendering is commonly used in audio production to create a final mix or master of a recording, where multiple tracks and effects are mixed together to create a stereo or multichannel audio file. During offline rendering, the audio processing is performed in real-time and then recorded to a new audio file.

Offline rendering can also be used for various other audio processing tasks, such as applying audio effects, normalizing audio levels, or converting audio file formats. Offline rendering can be done using various audio software applications, which often provide options for adjusting the processing parameters and settings used during rendering.

The benefits of offline rendering include the ability to use more processing power and time for audio processing, as well as the ability to render audio at higher quality than real-time playback. Additionally, offline rendering allows for the rendering of audio files in various formats, which can be useful for distribution or playback on different devices.

Using the OfflineGraphRenderer Class

You can process your AudioGraphs with the OfflineGraphRenderer class. This can be useful if you want to test out your graph and variables on multiple files, without the constraints of a realtime AudioPlayer/Recorder. For the moment, this is only available in C++.

Initialize the OfflineGraphRenderer instance and create your audio graph. In this example, it is a simple gain node with a gain of 0.5f (half volume).

OfflineGraphRenderer graphRenderer("~/renderer/tmp/");

GainNode gainNode;

AudioGraph graph;
graph.connect(graph.getInputNode(), gainNode);
graph.connect(gainNode, graph.getOutputNode());

Then you can run your graph on your desired file, and you are done.

graph, // Your graph to process
"input_file.mp3", // Input file name
switchboard::Codec::Mp3, // Input codec
44100, // Input file sample rate
"output_file.ogg", // Output file name
switchboard::Codec::Vorbis, // Output codec
44100 // Output file sample rate