Classes | |
class | AdvancedAudioPlayer |
High performance advanced audio player with: More... | |
struct | AES |
A structure to perform AES encryption. The size of the structure is 548 bytes. More... | |
class | Analyzer |
Performs bpm and key detection, loudness/peak analysis. More... | |
class | AndroidUSB |
This class manages USB device connections. More... | |
class | AndroidUSBAudio |
This class implements a custom low latency USB audio stack for Android, fully bypassing the Android system audio stack. More... | |
struct | AndroidUSBAudioIOInfo |
Information about an audio input or output. More... | |
class | AndroidUSBMIDI |
This class implements a custom low latency USB MIDI stack for Android, fully bypassing the Android system MIDI stack. More... | |
class | AudiobufferPool |
Manages a global audio buffer pool, reducing the number of memory allocation requests, increasing efficiency of audio applications. More... | |
class | AudiopointerList |
Manages an audio buffer list. More... | |
struct | AudiopointerlistElement |
An audio buffer list item. More... | |
class | BandpassFilterbank |
Efficient bandpass filter bank for real-time zero latency frequency analysis. Each band is a separated bandpass filter with custom width and center frequency. More... | |
class | Bitcrusher |
Bit crusher with adjustable frequency and bit depth. More... | |
class | Clipper |
Hard knee clipping with 0 latency. More... | |
class | Compressor |
Compressor with 0 latency. More... | |
class | CompressorProto |
The new Superpowered Compressor prototype. It can be used in production, but we're still collecting feedback on its feature set, therefore the documentation is not complete on this one. More... | |
class | CPU |
Utility class to keep the CPU running near the maximum frequency for all cores ("sustained performance mode"). More... | |
class | Decoder |
Audio file decoder. More... | |
class | Delay |
Simple delay with minimum memory operations. More... | |
class | Echo |
Simple echo ("delay effect"). More... | |
class | Filter |
Filter is an IIR filter based on the typical direct form 1 formula: y[n] = (b0/a0)*x[n] + (b1/a0)*x[n-1] + (b2/a0)*x[n-2] - (a1/a0)*y[n-1] - (a2/a0)*y[n-2] It doesn't allocate any internal buffers and needs just a few bytes of memory. More... | |
class | Flanger |
Flanger with aggressive sound ("jet"). More... | |
class | FrequencyDomain |
Transforms between time-domain and frequency-domain audio, including buffering, windowing (HanningZ) and window overlap handling (default: 4:1). More... | |
class | FX |
This is the base class for Superpowered effects. More... | |
class | Gate |
Simple gate effect. More... | |
class | GuitarDistortion |
Guitar distortion effect including Marshall cabinet, ADA cabinet and V-Twin preamp simulation, 5-band equalizer, bass and treble tone controls and two distortion sounds. More... | |
struct | hasher |
A structure for high-performance hashing. More... | |
struct | httpData |
A key/value pair used for custom data or headers in requests. More... | |
class | httpRequest |
HTTP request. More... | |
class | httpResponse |
Represents an in-progress or finished HTTP response. More... | |
struct | json |
Represents one JSON item, that can be a parent of other items (deep hierarchies are possible), a member of a linked list or just a simple data item (such as a string). More... | |
class | Limiter |
Limiter with 32 samples latency. More... | |
class | LiveAnalyzer |
Performs bpm and key detection continuously. More... | |
class | MonoMixer |
Mixes up to 4 mono inputs. Every input and the output has individual gain control. One instance allocates just a few bytes of memory, therefore combining multiple instances of the MonoMixer is the recommended way to support more than 4 channels. More... | |
class | Recorder |
Records audio into 16-bit WAV file, with an optional tracklist. More... | |
class | Resampler |
Linear or 6-point resampler, audio reverser and 16-bit to 32-bit audio converter. More... | |
class | Reverb |
CPU-friendly reverb. More... | |
class | Roll |
Bpm/beat based loop roll effect. More... | |
class | RSAPrivateKey |
RSA private key object. More... | |
class | RSAPublicKey |
Forward declaration. More... | |
class | Spatializer |
CPU-friendly 3D audio spatializer. More... | |
class | StereoMixer |
Mixes up to 4 stereo inputs. From the traditional mixer hardware point of view, every input and the output has dedicated metering, gain and pan controls. One instance allocates just a few bytes of memory, therefore combining multiple instances of the StereoMixer is the recommended way to support more than 4 channels. More... | |
class | ThreeBandEQ |
Classic three-band equalizer with unique characteristics and total kills. More... | |
class | TimeStretching |
Time stretching and pitch shifting. More... | |
class | Waveform |
Provides waveform data in 150 points/sec resolution. More... | |
class | Whoosh |
White noise + filter. More... | |
Typedefs | |
typedef void(* | AndroidUSBAudioDeviceConnectedCallback) (void *clientdata, int deviceID, const char *manufacturer, const char *product, const char *info) |
Called when a USB audio device is connected. More... | |
typedef void(* | AndroidUSBAudioDeviceDisconnectedCallback) (void *clientdata, int deviceID) |
Called when a USB audio device is disconnected. More... | |
typedef struct Superpowered::AndroidUSBAudioIOInfo | AndroidUSBAudioIOInfo |
Information about an audio input or output. More... | |
typedef bool(* | AndroidUSBAudioProcessingCallback) (void *clientdata, int deviceID, float *audioIO, int numberOfFrames, int samplerate, int numberOfInputChannels, int numberOfOutputChannels) |
This is the prototype of an audio processing callback function. More... | |
typedef void(* | AndroidUSBMIDIDeviceConnectedCallback) (void *clientdata, int deviceID, const char *manufacturer, const char *product) |
Called when a USB MIDI device is connected. More... | |
typedef void(* | AndroidUSBMIDIDeviceDisconnectedCallback) (void *clientdata, int deviceID) |
Called when a USB MIDI device is disconnected. More... | |
typedef void(* | AndroidUSBMIDIReceivedCallback) (void *clientdata, int deviceID, unsigned char *data, int bytes) |
This is the prototype of a MIDI callback function. More... | |
typedef struct Superpowered::AudiopointerlistElement | AudiopointerlistElement |
An audio buffer list item. More... | |
typedef enum Superpowered::Decoder_Format | Decoder_Format |
File/decoder format. More... | |
typedef enum Superpowered::FilterType | FilterType |
Superpowered filter types and their effective parameters: More... | |
typedef struct Superpowered::httpData | httpData |
A key/value pair used for custom data or headers in requests. More... | |
typedef enum Superpowered::httpDataMode | httpDataMode |
The mode for passing key/value data. More... | |
typedef void(* | httpLogCallback) (void *clientData, const char *str) |
Human readable HTTP transfer log. More... | |
typedef bool(* | httpRequestCallback) (void *clientData, httpRequest *request, httpResponse *response) |
Receive the progress of a httpRequest or the result of an asynchronous request with this callback. More... | |
typedef enum Superpowered::JogMode | JogMode |
Jog Wheel Mode, to be used with the jogT... methods. More... | |
typedef enum Superpowered::PlayerEvent | PlayerEvent |
Player events. More... | |
typedef enum Superpowered::SyncMode | SyncMode |
Synchronization modes. More... | |
Functions | |
void | Add1 (float *input, float *output, unsigned int numberOfItems) |
Adds the values in input to the values in output: output[n] += input[n]. More... | |
void | Add2 (float *inputA, float *inputB, float *output, unsigned int numberOfItems) |
Adds the values in two inputs to the values in output: output[n] += inputA[n] + inputB[n]. More... | |
void | Add4 (float *inputA, float *inputB, float *inputC, float *inputD, float *output, unsigned int numberOfItems) |
Adds the values in four inputs to the values in output: output[n] += inputA[n] + inputB[n] + inputC[n] + inputD[n]. More... | |
int | base64Decode (const char *input, char *output, const unsigned char *customTable=0) |
Base64 decoding. More... | |
int | base64Encode (const char *input, int inputLengthBytes, char *output, bool linebreakEvery64=false) |
Base64 encoding. More... | |
int | base64EncodeGetMaxOutputBytes (int length) |
Returns with the maximum bytes needed to store a base64 result. More... | |
void | Bit24ToFloat (void *input, float *output, unsigned int numberOfFrames, unsigned int numChannels=2) |
Converts 24-bit audio to 32-bit floating point. More... | |
void | ChangeVolume (float *input, float *output, float volumeStart, float volumeChange, unsigned int numberOfFrames) |
Applies volume on a single stereo interleaved buffer: output = input * gain. More... | |
void | ChangeVolumeAdd (float *input, float *output, float volumeStart, float volumeChange, unsigned int numberOfFrames) |
Applies volume on a single stereo interleaved buffer and adds it to the audio in the output buffer: output = output + input * gain. More... | |
void | CharToFloat (signed char *input, float *output, unsigned int numberOfFrames, unsigned int numChannels=2) |
Converts 8-bit audio to 32-bit floating point. More... | |
void | closeWAV (FILE *fd) |
Closes a 16-bit stereo WAV file. More... | |
FILE * | createWAV (const char *path, unsigned int samplerate, unsigned char numChannels) |
Creates a 16-bit WAV file. More... | |
void | CrossMono (float *inputA, float *inputB, float *output, float inputAGainStart, float inputAGainEnd, float inputBGainStart, float inputBGainEnd, unsigned int numberOfFrames) |
Crossfades two mono input channels into a mono output: output = inputA * gain + inputB + gain. More... | |
void | CrossStereo (float *inputA, float *inputB, float *output, float inputAGainStart, float inputAGainEnd, float inputBGainStart, float inputBGainEnd, unsigned int numberOfFrames) |
Crossfades two stereo inputs into a stereo output: output = inputA * gain + inputB + gain. More... | |
void | DeInterleave (float *input, float *left, float *right, unsigned int numberOfFrames) |
Deinterleaves an interleaved stereo input to two mono output channels: left = [L, L, L, L, ...], right = [R, R, R, R, ...]. More... | |
void | DeInterleaveAdd (float *input, float *left, float *right, unsigned int numberOfFrames) |
Deinterleaves an interleaved stereo input and adds the results to the two mono output channels: left = left + [L, L, L, L, ...], right = right + [R, R, R, R, ...]. More... | |
void | DeInterleaveMultiply (float *input, float *left, float *right, unsigned int numberOfFrames, float multiplier) |
Deinterleaves an interleaved stereo input to two mono output channels and multiplies the output (gain): left = [L, L, L, L, ...] * gain, right = [R, R, R, R, ...] * gain. More... | |
void | DeInterleaveMultiplyAdd (float *input, float *left, float *right, unsigned int numberOfFrames, float multiplier) |
Deinterleaves an interleaved stereo input to two mono output channels, multiplies the result (gain) and and adds the results to the two mono output channels: left = left + [L, L, L, L, ...] * gain, right = right + [R, R, R, R, ...] * gain. More... | |
char * | DERtoPEM (const char *der, int inputLengthBytes, bool privateKey) |
Creates a new string in PEM format from DER data. More... | |
float | DotProduct (float *inputA, float *inputB, unsigned int numValues) |
Calculates the dot product of two vectors. More... | |
void | DynamicDestroy () |
Use this if Superpowered is used in a dynamically loaded library (such as a DLL on Windows), when the dynamically loaded library instance unloads (even if multiple loads may happen). More... | |
void | DynamicInitialize (const char *licenseKey) |
Use this if Superpowered is loaded in a dynamically loaded library (such as a DLL on Windows). More... | |
void | FFTComplex (float *real, float *imag, int logSize, bool forward) |
Complex in-place FFT. More... | |
void | FFTReal (float *real, float *imag, int logSize, bool forward) |
Real in-place FFT. More... | |
void | FloatTo24bit (float *input, void *output, unsigned int numberOfFrames, unsigned int numChannels=2) |
Converts 32-bit floating point audio to 24-bit. More... | |
void | FloatToChar (float *input, signed char *output, unsigned int numberOfFrames, unsigned int numChannels=2) |
Converts 32-bit floating point audio 8-bit audio. More... | |
void | FloatToInt (float *input, int *output, unsigned int numberOfFrames, unsigned int numChannels=2) |
Converts 32-bit floating point audio to 32-bit integer. More... | |
void | FloatToShortInt (float *input, short int *output, unsigned int numberOfFrames, unsigned int numChannels=2) |
Converts 32-bit float input to 16-bit signed integer output. More... | |
void | FloatToShortIntInterleave (float *inputLeft, float *inputRight, short int *output, unsigned int numberOfFrames) |
Converts two 32-bit mono float input channels to stereo interleaved 16-bit signed integer output. More... | |
float | frequencyOfNote (int note) |
unsigned char | hashGetSizeBytes (hashType type) |
The hash size in bytes based on the hash type. More... | |
bool | HasNonFinite (float *buffer, unsigned int numberOfValues) |
Checks if the audio samples has non-valid values, such as infinity or NaN (not a number). More... | |
void | Initialize (const char *licenseKey, bool enableAudioAnalysis, bool enableFFTAndFrequencyDomain, bool enableAudioTimeStretching, bool enableAudioEffects, bool enableAudioPlayerAndDecoder, bool enableCryptographics, bool enableNetworking) |
Initializes the Superpowered SDKs. More... | |
void | Interleave (float *left, float *right, float *output, unsigned int numberOfFrames) |
Makes an interleaved stereo output from two mono input channels: output = [L, R, L, R, ...]. More... | |
void | InterleaveAdd (float *left, float *right, float *output, unsigned int numberOfFrames) |
void | InterleaveAndGetPeaks (float *left, float *right, float *output, unsigned int numberOfFrames, float *peaks) |
Makes an interleaved output from two input channels and measures the volume: output = [L, R, L, R, ...]. More... | |
void | IntToFloat (int *input, float *output, unsigned int numberOfFrames, unsigned int numChannels=2) |
Converts 32-bit integer audio to 32-bit floating point. More... | |
void | MidSideToStereo (float *input, float *output, unsigned int numberOfFrames) |
Converts a mid-side signal to stereo. More... | |
float | Peak (float *input, unsigned int numberOfValues) |
int | PEMtoDER (char *inputOutput) |
Converts a memory buffer with PEM format string to DER format. More... | |
void | PolarFFT (float *mag, float *phase, int logSize, bool forward, float valueOfPi=0) |
Polar FFT. More... | |
bool | printToString (char **str, int maxBytesNeeded, const char *format,...) |
Helper function to create a string with the same text that would be printed if format was used on printf, but instead of being printed, the content is stored as a C string. More... | |
void | ShortIntToFloat (short int *input, float *output, unsigned int numberOfFrames, float *peaks) |
Converts stereo interleaved 16-bit signed integer input to stereo interleaved 32-bit float output, and provides peak measurement. More... | |
void | ShortIntToFloat (short int *input, float *output, unsigned int numberOfFrames, unsigned int numChannels=2) |
Converts 16-bit signed integer input to 32-bit float output. More... | |
unsigned char | simpleHash (hashType type, unsigned int inputLengthBytes, const unsigned char *input, unsigned char *hash) |
Performs a simple hashing operation in one convenient line. More... | |
void | simpleHMAC (hashType type, const unsigned char *key, int keyLengthBytes, const unsigned char *input, int inputLengthBytes, unsigned char *output) |
Performs a simple hash-based message authentication code operation in one convenient line. More... | |
const char * | statusCodeToString (int code, const char *defaultString) |
User readable error string from a status code (including HTTP status codes). More... | |
void | StereoToMidSide (float *input, float *output, unsigned int numberOfFrames) |
Converts a stereo signal to mid-side. More... | |
void | StereoToMono (float *input, float *output, float leftGainStart, float leftGainEnd, float rightGainStart, float rightGainEnd, unsigned int numberOfFrames) |
Makes mono output from stereo interleaved input: output = [L + R], [L + R], [L + R], ... More... | |
char * | urlDecode (char *input, char *output) |
URL decode. More... | |
char * | urlEncode (char *input, char *output, bool spaceIsPlus=false) |
URL encode. More... | |
int | urlEncodeGetMaxOutputBytes (int length) |
Returns with the maximum bytes needed to store a URL encoded result. More... | |
unsigned int | Version () |
void | Volume (float *input, float *output, float volumeStart, float volumeEnd, unsigned int numberOfFrames) |
Applies volume on a single stereo interleaved buffer: output = input * gain. More... | |
void | VolumeAdd (float *input, float *output, float volumeStart, float volumeEnd, unsigned int numberOfFrames) |
Applies volume on a single stereo interleaved buffer and adds it to the audio in the output buffer: output = output + input * gain. More... | |
bool | writeWAV (FILE *fd, short int *audio, unsigned int numberOfBytes) |
Writes audio into a WAV file. More... | |
typedef void(* Superpowered::AndroidUSBAudioDeviceConnectedCallback) (void *clientdata, int deviceID, const char *manufacturer, const char *product, const char *info) |
Called when a USB audio device is connected.
clientdata | Some custom pointer you set at AndroidUSB::initialize(). |
deviceID | Device identifier. |
manufacturer | Manufacturer name. |
product | Product name. |
info | Detailed, user-readable USB information about the device. |
typedef void(* Superpowered::AndroidUSBAudioDeviceDisconnectedCallback) (void *clientdata, int deviceID) |
Called when a USB audio device is disconnected.
clientdata | Some custom pointer you set at AndroidUSB::initialize(). |
deviceID | Device identifier. |
Information about an audio input or output.
typedef bool(* Superpowered::AndroidUSBAudioProcessingCallback) (void *clientdata, int deviceID, float *audioIO, int numberOfFrames, int samplerate, int numberOfInputChannels, int numberOfOutputChannels) |
This is the prototype of an audio processing callback function.
Audio input is available in audioIO, and the application should change it's contents for audio output.
clientdata | A custom pointer your callback receives. |
deviceID | USB device identifier. |
audioIO | 32-bit interleaved audio input and/or output. |
numberOfFrames | The number of frames. |
samplerate | The current sample rate in Hz. |
numberOfInputChannels | Number of available input channels. |
numberOfOutputChannels | Number of available output channels. |
typedef void(* Superpowered::AndroidUSBMIDIDeviceConnectedCallback) (void *clientdata, int deviceID, const char *manufacturer, const char *product) |
Called when a USB MIDI device is connected.
clientdata | Some custom pointer you set at AndroidUSB::initialize(). |
deviceID | Device identifier. |
manufacturer | Manufacturer name. |
product | Product name. |
typedef void(* Superpowered::AndroidUSBMIDIDeviceDisconnectedCallback) (void *clientdata, int deviceID) |
Called when a USB MIDI device is disconnected.
clientdata | Some custom pointer you set at AndroidUSB::initialize(). |
deviceID | Device identifier. |
typedef void(* Superpowered::AndroidUSBMIDIReceivedCallback) (void *clientdata, int deviceID, unsigned char *data, int bytes) |
This is the prototype of a MIDI callback function.
clientdata | A custom pointer your callback receives. |
deviceID | USB device identifier. |
data | Raw MIDI data. |
bytes | Number of bytes. |
An audio buffer list item.
typedef enum Superpowered::Decoder_Format Superpowered::Decoder_Format |
File/decoder format.
typedef enum Superpowered::FilterType Superpowered::FilterType |
Superpowered filter types and their effective parameters:
typedef struct Superpowered::httpData Superpowered::httpData |
A key/value pair used for custom data or headers in requests.
typedef enum Superpowered::httpDataMode Superpowered::httpDataMode |
The mode for passing key/value data.
typedef void(* Superpowered::httpLogCallback) (void *clientData, const char *str) |
Human readable HTTP transfer log.
clientData | Your custom data. |
str | Log string. |
typedef bool(* Superpowered::httpRequestCallback) (void *clientData, httpRequest *request, httpResponse *response) |
Receive the progress of a httpRequest or the result of an asynchronous request with this callback.
clientData | Your custom data. |
request | The initiating request instance. |
response | HTTP response. |
typedef enum Superpowered::JogMode Superpowered::JogMode |
Jog Wheel Mode, to be used with the jogT... methods.
typedef enum Superpowered::PlayerEvent Superpowered::PlayerEvent |
Player events.
typedef enum Superpowered::SyncMode Superpowered::SyncMode |
Synchronization modes.
Superpowered filter types and their effective parameters:
The mode for passing key/value data.
Audio latency settings.
Player events.
Superpowered::Add1 | ( | float * | input, |
float * | output, | ||
unsigned int | numberOfItems | ||
) |
Adds the values in input to the values in output: output[n] += input[n].
input | Pointer to floating point numbers. Input data. |
output | Pointer to floating point numbers. Output data. |
numberOfItems | The length of input. |
Superpowered::Add2 | ( | float * | inputA, |
float * | inputB, | ||
float * | output, | ||
unsigned int | numberOfItems | ||
) |
Adds the values in two inputs to the values in output: output[n] += inputA[n] + inputB[n].
inputA | Pointer to floating point numbers. Input data. |
inputB | Pointer to floating point numbers. Input data. |
output | Pointer to floating point numbers. Output data. |
numberOfItems | The length of input. |
Superpowered::Add4 | ( | float * | inputA, |
float * | inputB, | ||
float * | inputC, | ||
float * | inputD, | ||
float * | output, | ||
unsigned int | numberOfItems | ||
) |
Adds the values in four inputs to the values in output: output[n] += inputA[n] + inputB[n] + inputC[n] + inputD[n].
inputA | Pointer to floating point numbers. Input data. |
inputB | Pointer to floating point numbers. Input data. |
inputC | Pointer to floating point numbers. Input data. |
inputD | Pointer to floating point numbers. Input data. |
output | Pointer to floating point numbers. Output data. |
numberOfItems | The length of input. |
int Superpowered::base64Decode | ( | const char * | input, |
char * | output, | ||
const unsigned char * | customTable = 0 |
||
) |
Base64 decoding.
input | Base64 encoded input string. |
output | The buffer for the decoded string. Must be big enough to store the output. Can be equal to input for in-place processing. Will be 0 terminated. |
customTable | Reserved. |
int Superpowered::base64Encode | ( | const char * | input, |
int | inputLengthBytes, | ||
char * | output, | ||
bool | linebreakEvery64 = false |
||
) |
Base64 encoding.
input | Input string. |
inputLengthBytes | Size of the input in bytes (not including trailing zero, can use strlen for this). |
output | Output buffer. Must be big enough to store the output (base64EncodeGetMaxOutputBytes can help). Can not be equal to input (in-place processing not supported). Will be 0 terminated. |
linebreakEvery64 | Set it to true to put a line break after every 64th character. |
int Superpowered::base64EncodeGetMaxOutputBytes | ( | int | length | ) |
Returns with the maximum bytes needed to store a base64 result.
length | Input length in bytes. |
Superpowered::Bit24ToFloat | ( | void * | input, |
float * | output, | ||
unsigned int | numberOfFrames, | ||
unsigned int | numChannels = 2 |
||
) |
Converts 24-bit audio to 32-bit floating point.
input | Input buffer pointer. |
output | Pointer to floating point numbers. 32-bit output. |
numberOfFrames | The number of frames to process. |
numChannels | The number of channels. |
Superpowered::ChangeVolume | ( | float * | input, |
float * | output, | ||
float | volumeStart, | ||
float | volumeChange, | ||
unsigned int | numberOfFrames | ||
) |
Applies volume on a single stereo interleaved buffer: output = input * gain.
input | Pointer to floating point numbers. 32-bit interleaved stereo input. |
output | Pointer to floating point numbers. 32-bit interleaved stereo output. Can be equal to input (in-place processing). |
volumeStart | Voume for the first frame. |
volumeChange | Change volume by this amount for every frame. |
numberOfFrames | The number of frames to process. |
Superpowered::ChangeVolumeAdd | ( | float * | input, |
float * | output, | ||
float | volumeStart, | ||
float | volumeChange, | ||
unsigned int | numberOfFrames | ||
) |
Applies volume on a single stereo interleaved buffer and adds it to the audio in the output buffer: output = output + input * gain.
input | Pointer to floating point numbers. 32-bit interleaved stereo input. |
output | Pointer to floating point numbers. 32-bit interleaved stereo output. |
volumeStart | Volume for the first frame. |
volumeChange | Change volume by this amount for every frame. |
numberOfFrames | The number of frames to process. |
Superpowered::CharToFloat | ( | signed char * | input, |
float * | output, | ||
unsigned int | numberOfFrames, | ||
unsigned int | numChannels = 2 |
||
) |
Converts 8-bit audio to 32-bit floating point.
input | Pointer to signed bytes. 8-bit input. |
output | Pointer to floating point numbers. 32-bit output. |
numberOfFrames | The number of frames to process. |
numChannels | The number of channels. |
void Superpowered::closeWAV | ( | FILE * | fd | ) |
Closes a 16-bit stereo WAV file.
fclose() is not enough to create a valid a WAV file, use this function to close it.
fd | The file handle to close. |
FILE * Superpowered::createWAV | ( | const char * | path, |
unsigned int | samplerate, | ||
unsigned char | numChannels | ||
) |
Creates a 16-bit WAV file.
After createWAV, write audio data using the writeWAV() function or fwrite(). Close the file with the closeWAV() function. Never use direct disk writing in a real-time audio processing thread, use the Superpowered Recorder class in that case.
path | The full filesystem path of the file. |
samplerate | Sample rate of the file in Hz. |
numChannels | The number of channels. |
Superpowered::CrossMono | ( | float * | inputA, |
float * | inputB, | ||
float * | output, | ||
float | inputAGainStart, | ||
float | inputAGainEnd, | ||
float | inputBGainStart, | ||
float | inputBGainEnd, | ||
unsigned int | numberOfFrames | ||
) |
Crossfades two mono input channels into a mono output: output = inputA * gain + inputB + gain.
inputA | Pointer to floating point numbers. First mono input. |
inputB | Pointer to floating point numbers. Second mono input. |
output | Pointer to floating point numbers. Mono output. Can be equal with one of the inputs (in-place processing). |
inputAGainStart | Gain of the first sample on the first input. |
inputAGainEnd | Gain for the last sample on the first input. Gain will be smoothly calculated between start end end. |
inputBGainStart | Gain of the first sample on the second input. |
inputBGainEnd | Gain for the last sample on the second input. Gain will be smoothly calculated between start end end. |
numberOfFrames | The number of frames to process. |
Superpowered::CrossStereo | ( | float * | inputA, |
float * | inputB, | ||
float * | output, | ||
float | inputAGainStart, | ||
float | inputAGainEnd, | ||
float | inputBGainStart, | ||
float | inputBGainEnd, | ||
unsigned int | numberOfFrames | ||
) |
Crossfades two stereo inputs into a stereo output: output = inputA * gain + inputB + gain.
inputA | Pointer to floating point numbers. Interleaved stereo input (first). |
inputB | Pointer to floating point numbers. Interleaved stereo input (second). |
output | Pointer to floating point numbers. Interleaved stereo output. Can be equal with one of the inputs (in-place processing). |
inputAGainStart | Gain of the first sample on the first input. |
inputAGainEnd | Gain for the last sample on the first input. Gain will be smoothly calculated between start end end. |
inputBGainStart | Gain of the first sample on the second input. |
inputBGainEnd | Gain for the last sample on the second input. Gain will be smoothly calculated between start end end. |
numberOfFrames | The number of frames to process. |
Superpowered::DeInterleave | ( | float * | input, |
float * | left, | ||
float * | right, | ||
unsigned int | numberOfFrames | ||
) |
Deinterleaves an interleaved stereo input to two mono output channels: left = [L, L, L, L, ...], right = [R, R, R, R, ...].
input | Pointer to floating point numbers. Stereo interleaved input. |
left | Pointer to floating point numbers. Mono output for left channel. |
right | Pointer to floating point numbers. Mono output for right channel. |
numberOfFrames | The number of frames to process. |
Superpowered::DeInterleaveAdd | ( | float * | input, |
float * | left, | ||
float * | right, | ||
unsigned int | numberOfFrames | ||
) |
Deinterleaves an interleaved stereo input and adds the results to the two mono output channels: left = left + [L, L, L, L, ...], right = right + [R, R, R, R, ...].
input | Pointer to floating point numbers. Stereo interleaved input. |
left | Pointer to floating point numbers. Mono output for left channel. |
right | Pointer to floating point numbers. Mono output for right channel. |
numberOfFrames | The number of frames to process. |
Superpowered::DeInterleaveMultiply | ( | float * | input, |
float * | left, | ||
float * | right, | ||
unsigned int | numberOfFrames, | ||
float | multiplier | ||
) |
Deinterleaves an interleaved stereo input to two mono output channels and multiplies the output (gain): left = [L, L, L, L, ...] * gain, right = [R, R, R, R, ...] * gain.
input | Pointer to floating point numbers. Stereo interleaved input. |
left | Pointer to floating point numbers. Mono output for left channel. |
right | Pointer to floating point numbers. Mono output for right channel. |
numberOfFrames | The number of frames to process. |
multiplier | Multiply each output sample with this value. |
Superpowered::DeInterleaveMultiplyAdd | ( | float * | input, |
float * | left, | ||
float * | right, | ||
unsigned int | numberOfFrames, | ||
float | multiplier | ||
) |
Deinterleaves an interleaved stereo input to two mono output channels, multiplies the result (gain) and and adds the results to the two mono output channels: left = left + [L, L, L, L, ...] * gain, right = right + [R, R, R, R, ...] * gain.
input | Pointer to floating point numbers. Stereo interleaved input. |
left | Pointer to floating point numbers. Mono output for left channel. |
right | Pointer to floating point numbers. Mono output for right channel. |
numberOfFrames | The number of frames to process. |
multiplier | Multiply each output sample with this value. |
char* Superpowered::DERtoPEM | ( | const char * | der, |
int | inputLengthBytes, | ||
bool | privateKey | ||
) |
Creates a new string in PEM format from DER data.
der | Input data in DER format. |
inputLengthBytes | DER length bytes. |
privateKey | True for private key, false for public key. |
Superpowered::DotProduct | ( | float * | inputA, |
float * | inputB, | ||
unsigned int | numValues | ||
) |
Calculates the dot product of two vectors.
inputA | Pointer to floating point numbers. First input vector. |
inputB | Pointer to floating point numbers. Second input vector. |
numValues | Number of value pairs to process. |
Superpowered::DynamicDestroy | ( | ) |
Use this if Superpowered is used in a dynamically loaded library (such as a DLL on Windows), when the dynamically loaded library instance unloads (even if multiple loads may happen).
This function will block waiting for all Superpowered background threads to exit when the last instance of the library is unloaded. Please note that you still need to "properly" release all Superpowered objects before this call, such as delete all players, effects, etc.
Superpowered::DynamicInitialize | ( | const char * | licenseKey | ) |
Use this if Superpowered is loaded in a dynamically loaded library (such as a DLL on Windows).
It allows for multiple loads (DLL in a VST host example). Enables all features.
licenseKey | Visit https://superpowered.com/dev to register license keys. |
Superpowered::FFTComplex | ( | float * | real, |
float * | imag, | ||
int | logSize, | ||
bool | forward | ||
) |
Complex in-place FFT.
Data packing is same as Apple's vDSP. Check the "Using Fourier Transforms" page of Apple's vDSP documentation ("Data Packing for Real FFTs").
real | Pointer to floating point numbers. Real part. |
imag | Pointer to floating point numbers. Imaginary part. |
logSize | Should be between 4 and 12 (FFT sizes 16 - 4096). |
forward | Forward or inverse. |
Superpowered::FFTReal | ( | float * | real, |
float * | imag, | ||
int | logSize, | ||
bool | forward | ||
) |
Real in-place FFT.
Data packing is same as Apple's vDSP. Check the "Using Fourier Transforms" page of Apple's vDSP documentation ("Data Packing for Real FFTs").
real | Pointer to floating point numbers. Real part. |
imag | Pointer to floating point numbers. Imaginary part. |
logSize | Should be 5 - 13 (FFT sizes 32 - 8192). |
forward | Forward or inverse. |
Superpowered::FloatTo24bit | ( | float * | input, |
void * | output, | ||
unsigned int | numberOfFrames, | ||
unsigned int | numChannels = 2 |
||
) |
Converts 32-bit floating point audio to 24-bit.
input | Pointer to floating point numbers. 32-bit input. |
output | Output buffer pointer. |
numberOfFrames | The number of frames to process. |
numChannels | The number of channels. |
Superpowered::FloatToChar | ( | float * | input, |
signed char * | output, | ||
unsigned int | numberOfFrames, | ||
unsigned int | numChannels = 2 |
||
) |
Converts 32-bit floating point audio 8-bit audio.
input | Pointer to floating point numbers. 32-bit input. |
output | Pointer to signed bytes. 8-bit output. |
numberOfFrames | The number of frames to process. |
numChannels | The number of channels. |
Superpowered::FloatToInt | ( | float * | input, |
int * | output, | ||
unsigned int | numberOfFrames, | ||
unsigned int | numChannels = 2 |
||
) |
Converts 32-bit floating point audio to 32-bit integer.
input | Pointer to floating point numbers. 32-bit input. |
output | Pointer to integer numbers. 32-bit output. |
numberOfFrames | The number of frames to process. |
numChannels | The number of channels. |
Superpowered::FloatToShortInt | ( | float * | input, |
short int * | output, | ||
unsigned int | numberOfFrames, | ||
unsigned int | numChannels = 2 |
||
) |
Converts 32-bit float input to 16-bit signed integer output.
input | Pointer to floating point numbers. 32-bit input. |
output | Pointer to short integer numbers. 16-bit output. |
numberOfFrames | The number of frames to process. |
numChannels | The number of channels. |
Superpowered::FloatToShortIntInterleave | ( | float * | inputLeft, |
float * | inputRight, | ||
short int * | output, | ||
unsigned int | numberOfFrames | ||
) |
Converts two 32-bit mono float input channels to stereo interleaved 16-bit signed integer output.
inputLeft | Pointer to floating point numbers. 32-bit input for the left side. Should be numberOfFrames + 8 big minimum. |
inputRight | Pointer to floating point numbers. 32-bit input for the right side. Should be numberOfFrames + 8 big minimum. |
output | Pointer to short integer numbers. Stereo interleaved 16-bit output. Should be numberOfFrames * 2 + 16 big minimum. |
numberOfFrames | The number of frames to process. |
float Superpowered::frequencyOfNote | ( | int | note | ) |
note | The number of the note. Note 0 is the standard A note at 440 Hz. |
unsigned char Superpowered::hashGetSizeBytes | ( | hashType | type | ) |
The hash size in bytes based on the hash type.
It doesn't require any hasher structure to be initialized.
type | The hash type. |
Superpowered::HasNonFinite | ( | float * | buffer, |
unsigned int | numberOfValues | ||
) |
Checks if the audio samples has non-valid values, such as infinity or NaN (not a number).
buffer | Pointer to floating point numbers to check. |
numberOfValues | Number of values in the buffer. Please note, this is NOT numberOfFrames. You need to provide the number of numbers in the buffer. |
Superpowered::Initialize | ( | const char * | licenseKey, |
bool | enableAudioAnalysis, | ||
bool | enableFFTAndFrequencyDomain, | ||
bool | enableAudioTimeStretching, | ||
bool | enableAudioEffects, | ||
bool | enableAudioPlayerAndDecoder, | ||
bool | enableCryptographics, | ||
bool | enableNetworking | ||
) |
Initializes the Superpowered SDKs.
Use this only once, when your app or library initializes. Do not use this if Superpowered is loaded dynamically and might be loaded multiple times (a DLL in a VST host for example).
licenseKey | Visit https://superpowered.com/dev to register license keys. |
enableAudioAnalysis | Enables Analyzer, LiveAnalyzer, Waveform and BandpassFilterbank. |
enableFFTAndFrequencyDomain | Enables FrequencyDomain, FFTComplex, FFTReal and PolarFFT. |
enableAudioTimeStretching | Enables TimeStretching. |
enableAudioEffects | Enables all effects and every class based on the FX class. |
enableAudioPlayerAndDecoder | Enables AdvancedAudioPlayer and Decoder. |
enableCryptographics | Enables RSAPublicKey,RSAPrivateKey, hasher and AES. |
enableNetworking | Enables httpRequest. |
Superpowered::Interleave | ( | float * | left, |
float * | right, | ||
float * | output, | ||
unsigned int | numberOfFrames | ||
) |
Makes an interleaved stereo output from two mono input channels: output = [L, R, L, R, ...].
Makes an interleaved stereo output from two mono input channels and adds the result to the audio in the output buffer: output = output + [L, R, L, R, ...].
left | Pointer to floating point numbers. Mono input for left channel. |
right | Pointer to floating point numbers. Mono input for right channel. |
output | Pointer to floating point numbers. Stereo interleaved output. |
numberOfFrames | The number of frames to process. |
void Superpowered::InterleaveAdd | ( | float * | left, |
float * | right, | ||
float * | output, | ||
unsigned int | numberOfFrames | ||
) |
Superpowered::InterleaveAndGetPeaks | ( | float * | left, |
float * | right, | ||
float * | output, | ||
unsigned int | numberOfFrames, | ||
float * | peaks | ||
) |
Makes an interleaved output from two input channels and measures the volume: output = [L, R, L, R, ...].
left | Pointer to floating point numbers. Mono input for left channel. |
right | Pointer to floating point numbers. Mono input for right channel. |
output | Pointer to floating point numbers. Stereo interleaved output. |
numberOfFrames | The number of frames to process. |
peaks | Pointer to two floating point numbers. Peak value result (left, right). |
Superpowered::IntToFloat | ( | int * | input, |
float * | output, | ||
unsigned int | numberOfFrames, | ||
unsigned int | numChannels = 2 |
||
) |
Converts 32-bit integer audio to 32-bit floating point.
input | Pointer to integer numbers. 32-bit input. |
output | Pointer to floating point numbers. 32-bit output. |
numberOfFrames | The number of frames to process. |
numChannels | The number of channels. |
Superpowered::MidSideToStereo | ( | float * | input, |
float * | output, | ||
unsigned int | numberOfFrames | ||
) |
Converts a mid-side signal to stereo.
input | Pointer to floating point numbers. Mid-side interleaved input. |
output | Pointer to floating point numbers. Interleaved stereo output. Can be equal to input (in-place processing). |
numberOfFrames | The number of frames to process. |
Superpowered::Peak | ( | float * | input, |
unsigned int | numberOfValues | ||
) |
input | Pointer to floating point numbers. |
numberOfValues | The number of values to process. For a stereo input this value should be 2 * numberOfFrames. Must be a multiply of 8. |
int Superpowered::PEMtoDER | ( | char * | inputOutput | ) |
Converts a memory buffer with PEM format string to DER format.
inputOutput | Input/output data. |
Superpowered::PolarFFT | ( | float * | mag, |
float * | phase, | ||
int | logSize, | ||
bool | forward, | ||
float | valueOfPi = 0 |
||
) |
Polar FFT.
Data packing is same as Apple's vDSP. Check the "Using Fourier Transforms" page of Apple's vDSP documentation ("Data Packing for Real FFTs").
mag | Pointer to floating point numbers. Input: split real part. Output: magnitudes. |
phase | Pointer to floating point numbers. Input: split real part. Output: phases. |
logSize | Should be 5 - 13 (FFT sizes 32 - 8192). |
forward | Forward or inverse. Inverse PolarFFT will clear (zero) the DC offset. |
valueOfPi | The function can translate pi to any value (Google: the tau manifesto). Use 0 for M_PI. |
bool Superpowered::printToString | ( | char ** | str, |
int | maxBytesNeeded, | ||
const char * | format, | ||
... | |||
) |
Helper function to create a string with the same text that would be printed if format was used on printf, but instead of being printed, the content is stored as a C string.
str | Input/output. If str is not NULL and the function returns with true, str will be deallocated with free() and replaced with the new string. |
maxBytesNeeded | The size of the str in bytes that will be allocated (including trailing zero). |
format | C string that contains a format string that follows the same specifications as format in printf. |
... | Additional arguments. return True on success, false on memory allocation error. |
Superpowered::ShortIntToFloat | ( | short int * | input, |
float * | output, | ||
unsigned int | numberOfFrames, | ||
float * | peaks | ||
) |
Converts stereo interleaved 16-bit signed integer input to stereo interleaved 32-bit float output, and provides peak measurement.
input | Pointer to short integer numbers. Stereo interleaved 16-bit input. Should be numberOfFrames + 8 big minimum. |
output | Pointer to floating point numbers. Stereo interleaved 32-bit output. Should be numberOfFrames + 8 big minimum. |
numberOfFrames | The number of frames to process. |
peaks | Pointer to two floating point numbers. Peak value result (left, right). |
Superpowered::ShortIntToFloat | ( | short int * | input, |
float * | output, | ||
unsigned int | numberOfFrames, | ||
unsigned int | numChannels = 2 |
||
) |
Converts 16-bit signed integer input to 32-bit float output.
input | Pointer to short integer numbers. Stereo interleaved 16-bit input. |
output | Pointer to floating point numbers. Stereo interleaved 32-bit output. |
numberOfFrames | The number of frames to process. |
numChannels | The number of channels. |
unsigned char Superpowered::simpleHash | ( | hashType | type, |
unsigned int | inputLengthBytes, | ||
const unsigned char * | input, | ||
unsigned char * | hash | ||
) |
Performs a simple hashing operation in one convenient line.
It doesn't require any hasher structure to be initialized.
type | The hash type. |
inputLengthBytes | Size of the input data in bytes. |
input | Pointer to the input data. |
hash | The output. Must be big enough to store the hash (SHA512 has the maximum with 64 bytes). |
void Superpowered::simpleHMAC | ( | hashType | type, |
const unsigned char * | key, | ||
int | keyLengthBytes, | ||
const unsigned char * | input, | ||
int | inputLengthBytes, | ||
unsigned char * | output | ||
) |
Performs a simple hash-based message authentication code operation in one convenient line.
It doesn't require any hasher structure to be initialized.
type | The hash type. |
key | The key. |
keyLengthBytes | The size of the key in bytes. |
input | Pointer to the input data. |
inputLengthBytes | Size of the input data in bytes. |
output | The output. Must be big enough to store the result (SHA512 has the maximum with 64 bytes). |
const char* Superpowered::statusCodeToString | ( | int | code, |
const char * | defaultString | ||
) |
User readable error string from a status code (including HTTP status codes).
code | The status code. |
defaultString | Generic error message if the status code has a value not covered. |
Superpowered::StereoToMidSide | ( | float * | input, |
float * | output, | ||
unsigned int | numberOfFrames | ||
) |
Converts a stereo signal to mid-side.
input | Pointer to floating point numbers. Interleaved stereo input. |
output | Pointer to floating point numbers. Mid-side interleaved output. Can be equal to input (in-place processing). |
numberOfFrames | The number of frames to process. |
Superpowered::StereoToMono | ( | float * | input, |
float * | output, | ||
float | leftGainStart, | ||
float | leftGainEnd, | ||
float | rightGainStart, | ||
float | rightGainEnd, | ||
unsigned int | numberOfFrames | ||
) |
Makes mono output from stereo interleaved input: output = [L + R], [L + R], [L + R], ...
input | Pointer to floating point numbers. Stereo interleaved input. |
output | Pointer to floating point numbers. Mono output. |
leftGainStart | Gain of the first sample on the left channel. |
leftGainEnd | Gain for the last sample on the left channel. Gain will be smoothly calculated between start end end. |
rightGainStart | Gain of the first sample on the right channel. |
rightGainEnd | Gain for the last sample on the right channel. Gain will be smoothly calculated between start end end. |
numberOfFrames | The number of frames to process. |
char* Superpowered::urlDecode | ( | char * | input, |
char * | output | ||
) |
URL decode.
input | Input string. |
output | Output string. Must be big enough to store the output (an output will have equal or less length than input). |
char* Superpowered::urlEncode | ( | char * | input, |
char * | output, | ||
bool | spaceIsPlus = false |
||
) |
URL encode.
input | Input string. |
output | Output string. Must be big enough to store the output (urlEncodeGetMaxOutputBytes can help). |
spaceIsPlus | True to use a "+" character for space. |
int Superpowered::urlEncodeGetMaxOutputBytes | ( | int | length | ) |
Returns with the maximum bytes needed to store a URL encoded result.
length | Input length in bytes. |
Superpowered::Version | ( | ) |
Superpowered::Volume | ( | float * | input, |
float * | output, | ||
float | volumeStart, | ||
float | volumeEnd, | ||
unsigned int | numberOfFrames | ||
) |
Applies volume on a single stereo interleaved buffer: output = input * gain.
input | Pointer to floating point numbers. 32-bit interleaved stereo input. |
output | Pointer to floating point numbers. 32-bit interleaved stereo output. Can be equal to input (in-place processing). |
volumeStart | Volume for the first frame. |
volumeEnd | Volume for the last frame. Volume will be smoothly calculated between the first and last frames. |
numberOfFrames | The number of frames to process. |
Superpowered::VolumeAdd | ( | float * | input, |
float * | output, | ||
float | volumeStart, | ||
float | volumeEnd, | ||
unsigned int | numberOfFrames | ||
) |
Applies volume on a single stereo interleaved buffer and adds it to the audio in the output buffer: output = output + input * gain.
input | Pointer to floating point numbers. 32-bit interleaved stereo input. |
output | Pointer to floating point numbers. 32-bit interleaved stereo output. |
volumeStart | Volume for the first frame. |
volumeEnd | Volume for the last frame. Volume will be smoothly calculated between the first and last frames. |
numberOfFrames | The number of frames to process. |
bool Superpowered::writeWAV | ( | FILE * | fd, |
short int * | audio, | ||
unsigned int | numberOfBytes | ||
) |
Writes audio into a WAV file.
fd | The file handle to write into. |
audio | Pointer to signed short integer numbers. Audio to write. |
numberOfBytes | The number of bytes to write. |