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

Public Member Functions

 Wave (const ::Wave &wave)
 
 Wave (const std::string &fileName)
 Load wave data from file. More...
 
 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 ()
 
inline ::Wave Copy ()
 Copy a wave to a new wave. More...
 
Wave & Crop (int initSample, int finalSample)
 Crop a wave to defined samples range. More...
 
bool Export (const std::string &fileName)
 Export wave data to file, returns true on success. More...
 
bool ExportAsCode (const std::string &fileName)
 Export wave sample data to code (.h), returns true on success. More...
 
Wave & Format (int SampleRate, int SampleSize, int Channels=2)
 Convert wave data to desired format. More...
 
unsigned int GetChannels () const
 
void * GetData () const
 
unsigned int GetSampleCount () const
 
unsigned int GetSampleRate () const
 
unsigned int GetSampleSize () const
 
float * LoadSamples ()
 Load samples data from wave as a floats array. More...
 
inline ::Sound LoadSound ()
 Load sound from wave data. More...
 
 operator Sound ()
 Load sound from wave data. More...
 
 operator::Sound ()
 Load sound from wave data. More...
 
Wave & operator= (const ::Wave &wave)
 
void SetChannels (unsigned int value)
 
void SetData (void *value)
 
void SetSampleCount (unsigned int value)
 
void SetSampleRate (unsigned int value)
 
void SetSampleSize (unsigned int value)
 
void Unload ()
 Unload wave data. More...
 
void UnloadSamples (float *samples)
 Unload samples data loaded with LoadWaveSamples() More...
 

Protected Member Functions

void set (const ::Wave &wave)
 

Detailed Description

Definition at line 34 of file Wave.hpp.

Constructor & Destructor Documentation

◆ Wave() [1/4]

raylib::Wave::Wave ( const ::Wave &  wave)
inline

Definition at line 36 of file Wave.hpp.

References set().

◆ Wave() [2/4]

raylib::Wave::Wave ( unsigned int  SampleCount = 0,
unsigned int  SampleRate = 0,
unsigned int  SampleSize = 0,
unsigned int  Channels = 0 
)
inline

Definition at line 40 of file Wave.hpp.

◆ Wave() [3/4]

raylib::Wave::Wave ( const std::string &  fileName)
inline

Load wave data from file.

Definition at line 54 of file Wave.hpp.

References set().

◆ Wave() [4/4]

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 61 of file Wave.hpp.

References set().

◆ ~Wave()

raylib::Wave::~Wave ( )
inline

Definition at line 65 of file Wave.hpp.

References Unload().

Member Function Documentation

◆ Copy()

inline ::Wave raylib::Wave::Copy ( )
inline

Copy a wave to a new wave.

Definition at line 91 of file Wave.hpp.

◆ Crop()

Wave& raylib::Wave::Crop ( int  initSample,
int  finalSample 
)
inline

Crop a wave to defined samples range.

Definition at line 98 of file Wave.hpp.

◆ Export()

bool raylib::Wave::Export ( const std::string &  fileName)
inline

Export wave data to file, returns true on success.

Definition at line 120 of file Wave.hpp.

◆ ExportAsCode()

bool raylib::Wave::ExportAsCode ( const std::string &  fileName)
inline

Export wave sample data to code (.h), returns true on success.

Definition at line 128 of file Wave.hpp.

◆ Format()

Wave& raylib::Wave::Format ( int  SampleRate,
int  SampleSize,
int  Channels = 2 
)
inline

Convert wave data to desired format.

Definition at line 83 of file Wave.hpp.

◆ GetChannels()

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

Definition at line 72 of file Wave.hpp.

◆ GetData()

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

Definition at line 73 of file Wave.hpp.

◆ GetSampleCount()

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

Definition at line 69 of file Wave.hpp.

◆ GetSampleRate()

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

Definition at line 70 of file Wave.hpp.

◆ GetSampleSize()

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

Definition at line 71 of file Wave.hpp.

◆ LoadSamples()

float* raylib::Wave::LoadSamples ( )
inline

Load samples data from wave as a floats array.

Definition at line 106 of file Wave.hpp.

◆ LoadSound()

inline ::Sound raylib::Wave::LoadSound ( )
inline

Load sound from wave data.

Definition at line 146 of file Wave.hpp.

Referenced by operator Sound(), and operator::Sound().

◆ operator Sound()

raylib::Wave::operator Sound ( )
inline

Load sound from wave data.

Definition at line 160 of file Wave.hpp.

References LoadSound().

◆ operator::Sound()

raylib::Wave::operator::Sound ( )
inline

Load sound from wave data.

Definition at line 153 of file Wave.hpp.

References LoadSound().

◆ operator=()

Wave& raylib::Wave::operator= ( const ::Wave &  wave)
inline

Definition at line 75 of file Wave.hpp.

References set().

◆ set()

void raylib::Wave::set ( const ::Wave &  wave)
inlineprotected

Definition at line 165 of file Wave.hpp.

Referenced by operator=(), and Wave().

◆ SetChannels()

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

Definition at line 72 of file Wave.hpp.

◆ SetData()

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

Definition at line 73 of file Wave.hpp.

◆ SetSampleCount()

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

Definition at line 69 of file Wave.hpp.

◆ SetSampleRate()

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

Definition at line 70 of file Wave.hpp.

◆ SetSampleSize()

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

Definition at line 71 of file Wave.hpp.

◆ Unload()

void raylib::Wave::Unload ( )
inline

Unload wave data.

Definition at line 136 of file Wave.hpp.

Referenced by ~Wave().

◆ UnloadSamples()

void raylib::Wave::UnloadSamples ( float *  samples)
inline

Unload samples data loaded with LoadWaveSamples()

Definition at line 113 of file Wave.hpp.