raylib-cpp
C++ object-oriented wrapper library for raylib.
Public Member Functions | List of all members
raylib::Wave Class Reference

Wave type, defines audio wave data. More...

Public Member Functions

 Wave (const ::Wave &wave)
 
 Wave (const std::string &fileName)
 Load wave data from file.
 
 Wave (const std::string &fileType, const unsigned char *fileData, int dataSize)
 Load wave from memory buffer, fileType refers to extension: i.e. More...
 
 Wave (unsigned int SampleCount=0, unsigned int SampleRate=0, unsigned int SampleSize=0, unsigned int Channels=0)
 
 ~Wave ()
 Unload wave data.
 
inline ::Wave Copy ()
 Copy a wave to a new wave.
 
Wave & Crop (int initSample, int finalSample)
 Crop a wave to defined samples range.
 
bool Export (const std::string &fileName)
 Export wave data to file, returns true on success.
 
bool ExportAsCode (const std::string &fileName)
 Export wave sample data to code (.h), returns true on success.
 
Wave & Format (int SampleRate, int SampleSize, int Channels=2)
 Convert wave data to desired format.
 
unsigned int GetChannels () const
 Retrieves the channels value for the object. More...
 
void * GetData () const
 Retrieves the data value for the object. More...
 
unsigned int GetSampleCount () const
 Retrieves the sampleCount value for the object. More...
 
unsigned int GetSampleRate () const
 Retrieves the sampleRate value for the object. More...
 
unsigned int GetSampleSize () const
 Retrieves the sampleSize value for the object. More...
 
float * LoadSamples ()
 Load samples data from wave as a floats array.
 
inline ::Sound LoadSound ()
 Load sound from wave data.
 
 operator Sound ()
 Load sound from wave data.
 
 operator::Sound ()
 Load sound from wave data.
 
Wave & operator= (const ::Wave &wave)
 
void SetChannels (unsigned int value)
 Sets the channels value for the object. More...
 
void SetData (void *value)
 Sets the data value for the object. More...
 
void SetSampleCount (unsigned int value)
 Sets the sampleCount value for the object. More...
 
void SetSampleRate (unsigned int value)
 Sets the sampleRate value for the object. More...
 
void SetSampleSize (unsigned int value)
 Sets the sampleSize value for the object. More...
 
void Unload ()
 Unload wave data.
 
void UnloadSamples (float *samples)
 Unload samples data loaded with LoadWaveSamples()
 

Detailed Description

Wave type, defines audio wave data.

Definition at line 13 of file Wave.hpp.

Constructor & Destructor Documentation

◆ Wave()

raylib::Wave::Wave ( const std::string &  fileType,
const unsigned char *  fileData,
int  dataSize 
)
inline

Load wave from memory buffer, fileType refers to extension: i.e.

"wav"

Definition at line 40 of file Wave.hpp.

Member Function Documentation

◆ GetChannels()

unsigned int raylib::Wave::GetChannels ( ) const
inline

Retrieves the channels value for the object.

Returns
The channels value of the object.

Definition at line 54 of file Wave.hpp.

◆ GetData()

void* raylib::Wave::GetData ( ) const
inline

Retrieves the data value for the object.

Returns
The data value of the object.

Definition at line 55 of file Wave.hpp.

◆ GetSampleCount()

unsigned int raylib::Wave::GetSampleCount ( ) const
inline

Retrieves the sampleCount value for the object.

Returns
The sampleCount value of the object.

Definition at line 51 of file Wave.hpp.

◆ GetSampleRate()

unsigned int raylib::Wave::GetSampleRate ( ) const
inline

Retrieves the sampleRate value for the object.

Returns
The sampleRate value of the object.

Definition at line 52 of file Wave.hpp.

◆ GetSampleSize()

unsigned int raylib::Wave::GetSampleSize ( ) const
inline

Retrieves the sampleSize value for the object.

Returns
The sampleSize value of the object.

Definition at line 53 of file Wave.hpp.

◆ SetChannels()

void raylib::Wave::SetChannels ( unsigned int  value)
inline

Sets the channels value for the object.

Parameters
valueThe value of which to set channels to.

Definition at line 54 of file Wave.hpp.

◆ SetData()

void raylib::Wave::SetData ( void *  value)
inline

Sets the data value for the object.

Parameters
valueThe value of which to set data to.

Definition at line 55 of file Wave.hpp.

◆ SetSampleCount()

void raylib::Wave::SetSampleCount ( unsigned int  value)
inline

Sets the sampleCount value for the object.

Parameters
valueThe value of which to set sampleCount to.

Definition at line 51 of file Wave.hpp.

◆ SetSampleRate()

void raylib::Wave::SetSampleRate ( unsigned int  value)
inline

Sets the sampleRate value for the object.

Parameters
valueThe value of which to set sampleRate to.

Definition at line 52 of file Wave.hpp.

◆ SetSampleSize()

void raylib::Wave::SetSampleSize ( unsigned int  value)
inline

Sets the sampleSize value for the object.

Parameters
valueThe value of which to set sampleSize to.

Definition at line 53 of file Wave.hpp.