Fireworks Engine  v2.0
Lightweight Sandbox Game Engine using OpenGL for additional Customisation and Quick Prototyping
fireworks::audio::AudioClip Class Reference

Class responsible for managing audio clips. More...

#include <audioclip.h>

Public Member Functions

 AudioClip (const std::string &filePath)
 Creates a audio clip to play in your application. More...
 
 ~AudioClip ()
 
void Play ()
 Play, Replay, or Resume a Source. More...
 
void Pause ()
 Pause a Source. More...
 
void Stop ()
 Stop a Source. More...
 
void Replay ()
 Rewind a Source (set playback position to beginning) More...
 
void PlayOnce ()
 Play the Source Once in any loop. More...
 
void PlayOnceOnly ()
 Play the Source only Once in any loop. More...
 
void Loop ()
 Play the Source in Looping mode in any loop. More...
 
std::uint32_t getAudioFormat () const
 Gets the audio format of the audio clip. More...
 
std::uint32_t getSampleRate () const
 Gets the sample rate of the audio clip. More...
 
std::uint32_t getBPS () const
 Gets the bits per second of the audio clip. More...
 
std::uint32_t getClipSizeinKB () const
 Gets the the clip size in Kb. More...
 
bool isLooping ()
 Tells whether the audio clip is in looping state or not. More...
 
bool isPaused ()
 Tells whether the audio clip is paused or not. More...
 
bool isPlaying ()
 Tells whether the audio clip is playing or not. More...
 
bool isStopped ()
 Tells whether the audio clip is stopped or not. More...
 
bool didPlayonce () const
 Tells whether if the audio clip did play at least once. More...
 
ALuint getBuffer () const
 Gets the Buffer of the audio clip data. More...
 
ALuint getSource () const
 Gets the Source ID of the audio source that plays the clip. More...
 

Public Attributes

int gain
 Sets the gain of the audio source. More...
 
int pitch
 Sets the pitch of the audio source. More...
 

Detailed Description

Class responsible for managing audio clips.

Constructor & Destructor Documentation

◆ AudioClip()

fireworks::audio::AudioClip::AudioClip ( const std::string &  filePath)

Creates a audio clip to play in your application.

Parameters
filePathThe file path of the audio clip
Note
currently only supports .WAV files

◆ ~AudioClip()

fireworks::audio::AudioClip::~AudioClip ( )

Member Function Documentation

◆ didPlayonce()

bool fireworks::audio::AudioClip::didPlayonce ( ) const
inline

Tells whether if the audio clip did play at least once.

◆ getAudioFormat()

std::uint32_t fireworks::audio::AudioClip::getAudioFormat ( ) const
inline

Gets the audio format of the audio clip.

Note
formats include 8-bit mono/stereo or 16-bit mono/stereo

◆ getBPS()

std::uint32_t fireworks::audio::AudioClip::getBPS ( ) const
inline

Gets the bits per second of the audio clip.

◆ getBuffer()

ALuint fireworks::audio::AudioClip::getBuffer ( ) const
inline

Gets the Buffer of the audio clip data.

◆ getClipSizeinKB()

std::uint32_t fireworks::audio::AudioClip::getClipSizeinKB ( ) const
inline

Gets the the clip size in Kb.

◆ getSampleRate()

std::uint32_t fireworks::audio::AudioClip::getSampleRate ( ) const
inline

Gets the sample rate of the audio clip.

◆ getSource()

ALuint fireworks::audio::AudioClip::getSource ( ) const
inline

Gets the Source ID of the audio source that plays the clip.

◆ isLooping()

bool fireworks::audio::AudioClip::isLooping ( )
inline

Tells whether the audio clip is in looping state or not.

◆ isPaused()

bool fireworks::audio::AudioClip::isPaused ( )
inline

Tells whether the audio clip is paused or not.

◆ isPlaying()

bool fireworks::audio::AudioClip::isPlaying ( )
inline

Tells whether the audio clip is playing or not.

◆ isStopped()

bool fireworks::audio::AudioClip::isStopped ( )
inline

Tells whether the audio clip is stopped or not.

◆ Loop()

void fireworks::audio::AudioClip::Loop ( )

Play the Source in Looping mode in any loop.

◆ Pause()

void fireworks::audio::AudioClip::Pause ( )

Pause a Source.

◆ Play()

void fireworks::audio::AudioClip::Play ( )

Play, Replay, or Resume a Source.

◆ PlayOnce()

void fireworks::audio::AudioClip::PlayOnce ( )

Play the Source Once in any loop.

◆ PlayOnceOnly()

void fireworks::audio::AudioClip::PlayOnceOnly ( )

Play the Source only Once in any loop.

◆ Replay()

void fireworks::audio::AudioClip::Replay ( )

Rewind a Source (set playback position to beginning)

◆ Stop()

void fireworks::audio::AudioClip::Stop ( )

Stop a Source.

Member Data Documentation

◆ gain

int fireworks::audio::AudioClip::gain

Sets the gain of the audio source.

◆ pitch

int fireworks::audio::AudioClip::pitch

Sets the pitch of the audio source.


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