#include <SoundBuffer.hpp>
Inheritance diagram for sfSoundBuffer:
Public Member Functions | |
sfSoundBuffer () | |
Default constructor. | |
sfSoundBuffer (const sfSoundBuffer &Copy) | |
Copy constructor. | |
~sfSoundBuffer () | |
Destructor. | |
bool | LoadFromFile (const std::string &Filename) |
Load the sound buffer from a file. | |
bool | LoadFromMemory (const sfInt16 *Samples, std::size_t SamplesCount, unsigned int ChannelsCount, unsigned int SampleRate) |
Load the sound buffer from memory - assumed format for samples is 16 bits signed integer. | |
bool | SaveToFile (const std::string &Filename) const |
Save the sound buffer to a file. | |
const sfInt16 * | GetSamples () const |
Return the sound samples. | |
std::size_t | GetSamplesCount () const |
Return the samples count. | |
unsigned int | GetSampleRate () const |
Get the sample rate. | |
unsigned int | GetChannelsCount () const |
Return the number of channels (1 = mono, 2 = stereo, . | |
float | GetDuration () const |
Get the sound duration. | |
sfSoundBuffer & | operator= (const sfSoundBuffer &Other) |
Assignment operator. | |
Friends | |
class | sfSound |
Definition at line 41 of file SoundBuffer.hpp.
sfSoundBuffer::sfSoundBuffer | ( | ) |
sfSoundBuffer::sfSoundBuffer | ( | const sfSoundBuffer & | Copy | ) |
Copy constructor.
Copy | : Instance to copy |
Definition at line 51 of file SoundBuffer.cpp.
sfSoundBuffer::~sfSoundBuffer | ( | ) |
bool sfSoundBuffer::LoadFromFile | ( | const std::string & | Filename | ) |
Load the sound buffer from a file.
Filename | : Path of the sound file to load |
Definition at line 76 of file SoundBuffer.cpp.
bool sfSoundBuffer::LoadFromMemory | ( | const sfInt16 * | Samples, | |
std::size_t | SamplesCount, | |||
unsigned int | ChannelsCount, | |||
unsigned int | SampleRate | |||
) |
Load the sound buffer from memory - assumed format for samples is 16 bits signed integer.
Samples | : Pointer to the samples in memory | |
SamplesCount | : Number of samples pointed by Samples | |
ChannelsCount | : Number of channels (1 = mono, 2 = stereo, ...) | |
SampleRate | : Frequency (number of samples to play per second) |
Definition at line 114 of file SoundBuffer.cpp.
bool sfSoundBuffer::SaveToFile | ( | const std::string & | Filename | ) | const |
Save the sound buffer to a file.
Filename | : Path of the sound file to write |
Definition at line 142 of file SoundBuffer.cpp.
const sfInt16 * sfSoundBuffer::GetSamples | ( | ) | const |
Return the sound samples.
Definition at line 168 of file SoundBuffer.cpp.
std::size_t sfSoundBuffer::GetSamplesCount | ( | ) | const |
unsigned int sfSoundBuffer::GetSampleRate | ( | ) | const |
Get the sample rate.
Definition at line 186 of file SoundBuffer.cpp.
unsigned int sfSoundBuffer::GetChannelsCount | ( | ) | const |
Return the number of channels (1 = mono, 2 = stereo, .
..)
Definition at line 198 of file SoundBuffer.cpp.
float sfSoundBuffer::GetDuration | ( | ) | const |
Get the sound duration.
Definition at line 210 of file SoundBuffer.cpp.
sfSoundBuffer & sfSoundBuffer::operator= | ( | const sfSoundBuffer & | Other | ) |
Assignment operator.
Other | : Instance to assign |
Definition at line 219 of file SoundBuffer.cpp.