Overview
Switchboard SDK is designed to be extensible. If you need functionality that isn't provided by the built-in nodes or extensions, you can create your own custom nodes and add them to your audio graphs.
Before creating custom nodes, familiarize yourself with the Switchboard SDK basics in the Using the SDK section. Understanding how nodes, engines, and audio graphs work will help you build better custom nodes.
Why Create a Custom Node?
- Add new audio effects or processing algorithms
- Integrate third-party DSP libraries
- Implement custom routing, analysis, or control logic
- Prototype and test new audio features
Development Requirements
Custom nodes must be developed in C++ using the Switchboard SDK Extension API. This ensures optimal performance and real-time safety for audio processing operations.
For complete API documentation, see the Extension API Reference.
The Process
Creating a custom node involves several key steps:
1. Creating a Custom Node Class
Every custom node starts by subclassing one of the core AudioNode types: AudioSourceNode for generating audio, AudioProcessorNode for processing audio, or AudioSinkNode for consuming audio. This establishes the foundation and determines how your node connects within audio graphs. Read more about subclassing AudioNode.
2. Defining Bus Formats
Before implementing your audio processing logic, you need to specify the audio bus formats your node supports. This includes defining channel configurations (mono, stereo, multi-channel) and sample rates that your node can handle. The SDK uses this information to validate connections and configure the audio pipeline. Learn how to implement bus formats.
3. Implementing Audio Processing
The heart of your custom node is the process() function where your audio processing logic runs. This is where you read input audio buffers, apply your DSP algorithms, and write to output buffers. Your implementation must be real-time safe and non-blocking, as it executes in the audio processing thread. Discover how to implement the process function.
4. Exposing Features
Make your node configurable and interactive by exposing features through multiple mechanisms:
- Configurations: Initial setup parameters defined at node creation, such as algorithm type or buffer sizes. These are typically set once and remain constant. Read more about configurations.
- Properties: Real-time parameters that can be changed during audio processing, like gain, frequency, or effect intensity. These allow dynamic control of your node's behavior. Learn about properties.
- Actions: Methods that can be triggered to perform specific operations, such as resetting state, loading presets, or triggering one-time events. Explore actions.
- Events: Notifications your node can emit to communicate state changes, analysis results, or errors back to the application layer. Understand events.
5. Packaging as an Extension
Once your custom node is implemented and tested, package it as a Switchboard SDK extension to make it reusable across projects. Extensions provide a clean distribution mechanism and allow your nodes to be integrated into any Switchboard SDK-based application. You can share extensions within your team, distribute them to customers, or even open-source them for the community. Learn how to create an extension.
For a ready-to-use starting point, check out the Switchboard SDK C++ Extension Template on GitHub.
Need Help?
If you have questions or want help building or integrating your custom node, contact us—we're happy to help!