Class AudioAnalyzerStream

Nested Relationships

Nested Types

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(uint16 numChannels, uint32 sampleRate, int bitDepth, uint8 audioFormat, float audioBufferSeconds, bool enablePlayback, uint32 periodSizeInFrames, uint32 periodSizeInMilliseconds, uint32 periods)

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

  • audioBufferSeconds – Audio buffer size in seconds

  • enablePlayback – Enables a playback of the audio

  • periodSizeInFrames – Device audio buffer size in frames (power of 2), 0 to use default value

  • periodSizeInMilliseconds – Device audio buffer size in milliseconds, 0 to use default value

  • periods – Device audio buffer size multiplier

Returns:

The audio initilization result

void unloadAudio()

Closes the audio capturer (and player) device

void open(bool enablePlayback)

Open the audio stream capture (and start playback)

Parameters:

enablePlayback – Indicates if we want to playback the captured audio too

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