Class AudioAnalyzerStream

Inheritance Relationships

Base Type

Class Documentation

class AudioAnalyzerStream : public AudioAnalyzerSource

Audio Analyzer Stream Source.

Public Functions

AudioAnalyzerStream()

Constructor

~AudioAnalyzerStream()

Destructor This will unload the audio too

AudioAnalyzerStream(AudioAnalyzerStream const &x) = delete

Disable copy constructor

Parameters

x

void operator=(AudioAnalyzerStream const &x) = delete

Disable copy assignment

Parameters

x

bool initializeAudio(int16_t numChannels, uint32_t sampleRate, int bitDepth, int16_t audioFormat, uint16 playbackBufferSize, bool enablePlayback)

Initializes the capturer audio info and opens the audio capture (and player) device

Parameters
  • numChannels – Number of channels

  • sampleRate – Samples per second

  • bitDepth – Bits per sample

  • audioFormat – Audio format

  • playbackBufferSize – Playback buffer size

  • enablePlayback – Enables a playback of the audio

Returns

The audio initilization result

void unloadAudio()

Closes the audio capturer (and player) device

void feed(unsigned char *data, size_t dataSize)

Starts the audio stream capture (and player playback)

Parameters
  • data – Buffer of audio samples

  • dataSize – Size of the buffer

void close()

Closes the audio stream capture (and stop player playback)

bool isCapturing() const

Returns if the device is currently capturing stream audio

Returns

Device has data into the buffer

virtual float getPlaybackProgress(float &bufferPosTime)

Returns the total capture duration and buffer postion time

Parameters

bufferPosTime[out] Current buffer position (seconds)

Returns

float Duration in seconds

float getPlaybackProgress()

Returns the total capture duration

Returns

float Duration in seconds

void setDefaultAudioDevice(const FString &sourceDeviceName)

Set default source audio device

Parameters

sourceDeviceName – Audio device name

void getDefaultAudioDevice(FString &sourceDeviceName)

Get default source audio device

Parameters

sourceDeviceName[out] Audio device name

inline virtual bool hasOnlyHeader() const

Returns if only has been loaded the header data

Returns

Has onkly header data

inline virtual bool needsBufferOffset() const

Returns if the buffer needs to be offset

Returns

Needs buffer offset

const AudioAnalyzerDeviceInfo &getAudioPlayerDeviceInfo() const

(Const) Returns the player audio device info

Returns

Audio device info structure