SuperpoweredSDK  v2.0.2
Superpowered Audio SDK
Superpowered::Waveform Class Reference

Provides waveform data in 150 points/sec resolution. More...

#include "SuperpoweredAnalyzer.h"

Public Member Functions

 Waveform (unsigned int samplerate, int lengthSeconds)
 Constructor. More...
 
 ~Waveform ()
 
void makeResult ()
 Makes the result from the collected data. This method should NOT be used in a real-time audio thread. More...
 
void process (float *input, unsigned int numberOfFrames, int lengthSeconds=-1)
 Processes some audio. More...
 

Public Attributes

unsigned char * peakWaveform
 150 points/sec waveform data displaying the peak volume. Each byte represents one "pixel". Available after calling makeResult(). More...
 
int waveformSize
 The number of bytes in the peak waveform. More...
 

Private Member Functions

 Waveform (const Waveform &)
 
Waveformoperator= (const Waveform &)
 

Private Attributes

waveformInternals * internals
 

Detailed Description

Provides waveform data in 150 points/sec resolution.

To keep the array result after you destruct the analyzer without an expensive memory copy, do this: float *peakWaveform = waveform->peakWaveform; waveform->peakWaveform = NULL; In this case you take ownership on the data, so don't forget to free() the memory to prevent memory leaks. Use _aligned_free() on Windows.

Constructor & Destructor Documentation

◆ Waveform() [1/2]

Superpowered::Waveform::Waveform ( unsigned int  samplerate,
int  lengthSeconds 
)

Constructor.

Parameters
samplerateThe sample rate of the audio input.
lengthSecondsThe length in seconds of the audio input. It will not be able to process more audio than this. You can change this value in the process() method.

◆ ~Waveform()

Superpowered::Waveform::~Waveform ( )

◆ Waveform() [2/2]

Superpowered::Waveform::Waveform ( const Waveform )
private

Member Function Documentation

◆ makeResult()

void Superpowered::Waveform::makeResult ( )

Makes the result from the collected data. This method should NOT be used in a real-time audio thread.

◆ operator=()

Waveform& Superpowered::Waveform::operator= ( const Waveform )
private

◆ process()

void Superpowered::Waveform::process ( float *  input,
unsigned int  numberOfFrames,
int  lengthSeconds = -1 
)

Processes some audio.

This method can be used in a real-time audio thread if lengthSeconds is -1.

Parameters
inputPointer to floating point numbers. 32-bit interleaved stereo input.
numberOfFramesNumber of frames to process.
lengthSecondsIf the audio input length may change, set this to the current length. Use -1 otherwise. If this value is not -1, this method can NOT be used in a real-time audio thread.

Member Data Documentation

◆ internals

waveformInternals* Superpowered::Waveform::internals
private

◆ peakWaveform

unsigned char* Superpowered::Waveform::peakWaveform

150 points/sec waveform data displaying the peak volume. Each byte represents one "pixel". Available after calling makeResult().

◆ waveformSize

int Superpowered::Waveform::waveformSize

The number of bytes in the peak waveform.


The documentation for this class was generated from the following file: