Getting started with the Windows SDK (C++)
Adding Superpowered to your project
Download the SDK from here. We recommend copying the libWindows
folder and the .h
header files from the Superpowered directory to your project's directory.
Open your project's properties and add the path of the Superpowered header files to the AdditionalIncludeDirectories
value. Then, link the Superpowered library using the following code snippet. This code snippet makes sure that the correct lib file is linked with the right configuration and platform.
#if _DEBUG#define CONFIGURATION "Debug"#else#define CONFIGURATION "Release"#endif#if _M_ARM#define PLATFORM "ARM"#elif _M_X64#define PLATFORM "x64"#else#define PLATFORM "x86"#endif#pragma comment(lib, "..\\..\\Superpowered\\libWindows\\SuperpoweredWin143_" CONFIGURATION "_MT_" PLATFORM ".lib")
Initializing Superpowered
Before you can start using Superpowered you need to initialize the library. Import the Superpowered.h
header file and call the Superpowered::Initialize
function.
#include <Superpowered.h>...Superpowered::Initialize("ExampleLicenseKey-WillExpire-OnNextUpdate");
Integrating Superpowered with Windows audio
To quickly integrate Superpowered with Windows audio you can copy the SuperpoweredWASAPIAudioIO.h
and SuperpoweredWASAPIAudioIO.cpp
files from the Superpowered SDK package to your project. This file implements a class that configures the audio device and an audio processing callback.
// Audio output should be provided here. Runs periodically on the audio I/O thread.static bool audioProcessing(void *clientdata, float *input, float *output, int numberOfFrames, int samplerate) {return false;}...audioIO = new SuperpoweredWASAPIAudioIO(audioProcessing, NULL, 12, 2, false, true);audioIO->start();
is not supported here.