Class AudioAnalyzerPlayerUnitFile

Nested Relationships

Nested Types

Inheritance Relationships

Base Type

Class Documentation

class AudioAnalyzerPlayerUnitFile : public AudioAnalyzerPlayerUnit

Audio Analyzer Player Unit File.

This class will be used to load audio from a disk file and interact with it using the most basic player options (play/stop/pause)

Public Functions

AudioAnalyzerPlayerUnitFile()

Constructor

AudioAnalyzerPlayerUnitFile(AudioAnalyzerPlayer*)

Constructor

~AudioAnalyzerPlayerUnitFile()

Destructor This will unload the loaded audio too

AudioAnalyzerPlayerUnitFile(AudioAnalyzerPlayerUnitFile const &x) = delete

Disable copy constructor

Parameters:

x – —

void operator=(AudioAnalyzerPlayerUnitFile const &x) = delete

Disable copy assignment

Parameters:

x – —

virtual bool loadAudio(uint32 periodSizeInFrames, uint32 periodSizeInMilliseconds, uint32 periods)

Initializes the player device

Parameters:
  • 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:

Audio initilization execution result

virtual void unloadAudio()

Closes audio player device

virtual void play(int maxLoops, float startTime)

Starts audio playback

Parameters:
  • maxLoops – Number of loops

  • startTime – Starting position(seconds)

virtual void stop()

Stops audio playback

virtual void pause(bool forcePause = true)

Pauses audio playback if the device is in playing state UnPauses audio playback if the device has been paused previously

Parameters:

forcePause – Set the pause to this state

virtual bool isPlaying() const

Returns if the device is currently playing audio

Returns:

Device is playing

virtual bool isPaused() const

Returns if the device is currently paused

Returns:

Device is paused

virtual float getPlaybackProgress(float &bufferPosTime)

Returns the playback progress and buffer postion time

Parameters:

bufferPosTime[out] Buffer position (same as below value)

Returns:

float Progress in seconds

virtual float getPlaybackProgress()

Returns the playback progress

Returns:

float Progress in seconds

virtual void setPlaybackProgress(float time)

Sets the playback progress

Parameters:

time – New playback position in seconds

virtual float getPlaybackVolume()

Returns the playback volume

Returns:

volume in range 0.0-1.0

virtual void setPlaybackVolume(float volume)

Sets the playback volume

Parameters:

volume – New volume in range 0.0-1.0

virtual float getTotalDuration() const

Returns the total audio duration

Returns:

Duration in seconds

virtual void setAudioBufferSize(float seconds)

Sets a new buffer audio size

Parameters:

seconds – Buffer size in seconds