Raylib C++  1.0.0
Encapsulates the raylib library
Public Member Functions | List of all members
raylib::audio::RlSound Class Reference

Encapulation of the raylib Sound. More...

#include <RlSound.hpp>

Inheritance diagram for raylib::audio::RlSound:
Inheritance graph
Collaboration diagram for raylib::audio::RlSound:
Collaboration graph

Public Member Functions

 RlSound (const Sound &sound)
 Construct a new RlSound object from the raylib Sound. More...
 
 RlSound (const std::string &fileName)
 Construct a new RlSound object from a file. More...
 
 RlSound (const RlWave &wave)
 Construct a new RlSound object from a RlWave. More...
 
 ~RlSound ()
 Destroy the RlSound object. More...
 
void update (const void *data, const int &samplesCount)
 Update sound buffer with new data. More...
 
void play ()
 Play the sound. More...
 
void stop ()
 Stop the sound. More...
 
void pause ()
 Pause the sound. More...
 
void resume ()
 Resume the sound. More...
 
void playMulti ()
 Play a sound (using multichannel buffer pool) More...
 
bool isPlaying ()
 Check if a sound is currently playing. More...
 
void setVolume (const float &volume)
 Set volume for a sound (1.0 is max level) More...
 
const float & getVolume () const
 Get the volume of a sound. More...
 
void setPitch (const float &pitch)
 Set pitch for a sound (1.0 is base level) More...
 

Detailed Description

Encapulation of the raylib Sound.

Forward declaration

Constructor & Destructor Documentation

◆ RlSound() [1/3]

raylib::audio::RlSound::RlSound ( const Sound &  sound)
explicit

Construct a new RlSound object from the raylib Sound.

Parameters
soundthe raylib Sound

◆ RlSound() [2/3]

raylib::audio::RlSound::RlSound ( const std::string &  fileName)
explicit

Construct a new RlSound object from a file.

Parameters
fileNamethe name of the file

◆ RlSound() [3/3]

raylib::audio::RlSound::RlSound ( const RlWave wave)
explicit

Construct a new RlSound object from a RlWave.

Parameters
wavethe RlWave

◆ ~RlSound()

raylib::audio::RlSound::~RlSound ( )

Destroy the RlSound object.

Member Function Documentation

◆ getVolume()

const float & raylib::audio::RlSound::getVolume ( ) const

Get the volume of a sound.

Returns
the volume

◆ isPlaying()

bool raylib::audio::RlSound::isPlaying ( )

Check if a sound is currently playing.

Returns
true if the sound is playing

◆ pause()

void raylib::audio::RlSound::pause ( )

Pause the sound.

◆ play()

void raylib::audio::RlSound::play ( )

Play the sound.

◆ playMulti()

void raylib::audio::RlSound::playMulti ( )

Play a sound (using multichannel buffer pool)

Here is the caller graph for this function:

◆ resume()

void raylib::audio::RlSound::resume ( )

Resume the sound.

◆ setPitch()

void raylib::audio::RlSound::setPitch ( const float &  pitch)

Set pitch for a sound (1.0 is base level)

Parameters
pitchthe pitch

◆ setVolume()

void raylib::audio::RlSound::setVolume ( const float &  volume)

Set volume for a sound (1.0 is max level)

Parameters
volumethe volume
Here is the caller graph for this function:

◆ stop()

void raylib::audio::RlSound::stop ( )

Stop the sound.

◆ update()

void raylib::audio::RlSound::update ( const void *  data,
const int &  samplesCount 
)

Update sound buffer with new data.

Parameters
datathe new data
samplesCountthe number of samples

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