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

Wave/Sound management functions. More...

Public Member Functions

 Sound (const ::Sound &vec)
 
 Sound (const ::Wave &wave)
 
 Sound (const std::string &fileName)
 
 ~Sound ()
 
unsigned int GetSampleCount () const
 
inline ::AudioStream GetStream () const
 
bool IsPlaying () const
 Check if a sound is currently playing. More...
 
Sound & operator= (const ::Sound &sound)
 
Sound & Pause ()
 Pause a sound. More...
 
Sound & Play ()
 Play a sound. More...
 
Sound & PlayMulti ()
 Play a sound (using multichannel buffer pool) More...
 
Sound & Resume ()
 Resume a paused sound. More...
 
Sound & SetPitch (float pitch)
 Set pitch for a sound (1.0 is base level) More...
 
void SetSampleCount (unsigned int value)
 
void SetStream (::AudioStream value)
 
Sound & SetVolume (float volume)
 Set volume for a sound (1.0 is max level) More...
 
Sound & Stop ()
 Stop playing a sound. More...
 
Sound & StopMulti ()
 Stop any sound playing (using multichannel buffer pool) More...
 
void Unload ()
 Unload sound. More...
 
Sound & Update (const void *data, int sampleCount)
 Update sound buffer with new data. More...
 

Protected Member Functions

void set (const ::Sound &sound)
 

Detailed Description

Wave/Sound management functions.

Definition at line 37 of file Sound.hpp.

Constructor & Destructor Documentation

◆ Sound() [1/3]

raylib::Sound::Sound ( const ::Sound &  vec)
inline

Definition at line 39 of file Sound.hpp.

References set().

◆ Sound() [2/3]

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

Definition at line 43 of file Sound.hpp.

References set().

◆ Sound() [3/3]

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

Definition at line 47 of file Sound.hpp.

References set().

◆ ~Sound()

raylib::Sound::~Sound ( )
inline

Definition at line 51 of file Sound.hpp.

References Unload().

Member Function Documentation

◆ GetSampleCount()

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

Definition at line 55 of file Sound.hpp.

◆ GetStream()

inline ::AudioStream raylib::Sound::GetStream ( ) const
inline

Definition at line 56 of file Sound.hpp.

◆ IsPlaying()

bool raylib::Sound::IsPlaying ( ) const
inline

Check if a sound is currently playing.

Definition at line 129 of file Sound.hpp.

◆ operator=()

Sound& raylib::Sound::operator= ( const ::Sound &  sound)
inline

Definition at line 58 of file Sound.hpp.

References set().

◆ Pause()

Sound& raylib::Sound::Pause ( )
inline

Pause a sound.

Definition at line 97 of file Sound.hpp.

◆ Play()

Sound& raylib::Sound::Play ( )
inline

Play a sound.

Definition at line 81 of file Sound.hpp.

◆ PlayMulti()

Sound& raylib::Sound::PlayMulti ( )
inline

Play a sound (using multichannel buffer pool)

Definition at line 113 of file Sound.hpp.

◆ Resume()

Sound& raylib::Sound::Resume ( )
inline

Resume a paused sound.

Definition at line 105 of file Sound.hpp.

◆ set()

void raylib::Sound::set ( const ::Sound &  sound)
inlineprotected

Definition at line 150 of file Sound.hpp.

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

◆ SetPitch()

Sound& raylib::Sound::SetPitch ( float  pitch)
inline

Set pitch for a sound (1.0 is base level)

Definition at line 144 of file Sound.hpp.

◆ SetSampleCount()

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

Definition at line 55 of file Sound.hpp.

◆ SetStream()

void raylib::Sound::SetStream ( ::AudioStream  value)
inline

Definition at line 56 of file Sound.hpp.

◆ SetVolume()

Sound& raylib::Sound::SetVolume ( float  volume)
inline

Set volume for a sound (1.0 is max level)

Definition at line 136 of file Sound.hpp.

◆ Stop()

Sound& raylib::Sound::Stop ( )
inline

Stop playing a sound.

Definition at line 89 of file Sound.hpp.

◆ StopMulti()

Sound& raylib::Sound::StopMulti ( )
inline

Stop any sound playing (using multichannel buffer pool)

Definition at line 121 of file Sound.hpp.

◆ Unload()

void raylib::Sound::Unload ( )
inline

Unload sound.

Definition at line 74 of file Sound.hpp.

Referenced by ~Sound().

◆ Update()

Sound& raylib::Sound::Update ( const void *  data,
int  sampleCount 
)
inline

Update sound buffer with new data.

Definition at line 66 of file Sound.hpp.