How to Build Custom Audio Plugins Using foobar2000 SDK

Written by

in

Getting started with foobar2000 component development requires a strong foundation in native C++, as the media player relies heavily on its own high-performance, object-oriented framework.

The primary resource for developers is the official foobar2000 SDK download page. The SDK archive includes essential headers, helper libraries, code samples, and a readme.html file outlining basic setup. Required Development Tools

IDE: Microsoft Visual Studio (2019 or 2022 recommended for Windows) or Xcode for macOS.

UI Toolkit (Optional): Windows Template Library (WTL) if you plan to build default user interface elements. Step-by-Step Initial Setup Establish a Sandbox Environment

Install a fresh copy of foobar2000 in Portable mode to a test directory (e.g., C: oobar2000_test).

This isolates your active development/debugging sessions from your main personal media player. Organize the SDK Architecture

Download and extract the latest foobar2000 SDK into your workspace directory.

The directory will include three core foundational projects:

pfc (Pfc.lib): The proprietary foundational library handling basic data structures, strings, and memory management.

foobar2000_SDK: Contains core class declarations and API entry points.

foobar2000_componentclient: Integrates the generic entry points linking your DLL directly into the foobar2000 core executable. Configure Your Project

Create a new C++ Win32 Project / Dynamic-Link Library (DLL) template.

Your target binary must follow the foo*.dll naming convention (e.g., foomyplugin.dll). The core application ignores any binaries lacking the foo prefix.

Set up your project dependencies to explicitly link against pfc, foobar2000_SDK, and foobar2000_component_client. Target Architectures (v2.0+ Compatibility)

Ensure you compile different binaries depending on your user targets.

Modern foobar2000 supports x86 32-bit, x86 64-bit, and native ARM64. Essential SDK Architectural Concepts

Foobar2000 relies on an internal database of structural classes known as Services. Rather than using traditional object derivation across boundaries, you implement services to extend capabilities:

Entry Points (service_factory): To register custom behavior, instantiate a structural template wrapper like service_factory_single_t inside a source file. The system registers this implicitly at startup.

Component Packaging: Final compiled components must be archived in a standard .zip file and renamed with the extension .fb2k-component. This structure can contain separate folders for individual target architectures. Common Component Types

Depending on your engineering goals, your custom class will subclass specific base pointers:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *