SoundBuffer is the low-level for loading and manipulating sound buffers. More...
#include <SoundBuffer.hpp>
Public Member Functions | |
SoundBuffer () | |
Default constructor. More... | |
SoundBuffer (const SoundBuffer &Copy) | |
Copy constructor. More... | |
~SoundBuffer () | |
Destructor. More... | |
bool | LoadFromFile (const std::string &Filename) |
Load the sound buffer from a file. More... | |
bool | LoadFromMemory (const char *Data, std::size_t SizeInBytes) |
Load the sound buffer from a file in memory. More... | |
bool | LoadFromSamples (const Int16 *Samples, std::size_t SamplesCount, unsigned int ChannelsCount, unsigned int SampleRate) |
Load the sound buffer from an array of samples - assumed format for samples is 16 bits signed integer. More... | |
bool | SaveToFile (const std::string &Filename) const |
Save the sound buffer to a file. More... | |
const Int16 * | GetSamples () const |
Return the sound samples. More... | |
std::size_t | GetSamplesCount () const |
Return the samples count. More... | |
unsigned int | GetSampleRate () const |
Get the sample rate. More... | |
unsigned int | GetChannelsCount () const |
Return the number of channels (1 = mono, 2 = stereo, ...) More... | |
float | GetDuration () const |
Get the sound duration. More... | |
SoundBuffer & | operator= (const SoundBuffer &Other) |
Assignment operator. More... | |
Friends | |
class | Sound |
SoundBuffer is the low-level for loading and manipulating sound buffers.
Definition at line 46 of file SoundBuffer.hpp.
sf::SoundBuffer::SoundBuffer | ( | ) |
Default constructor.
Definition at line 42 of file SoundBuffer.cpp.
sf::SoundBuffer::SoundBuffer | ( | const SoundBuffer & | Copy | ) |
sf::SoundBuffer::~SoundBuffer | ( | ) |
Destructor.
Definition at line 73 of file SoundBuffer.cpp.
unsigned int sf::SoundBuffer::GetChannelsCount | ( | ) | const |
Return the number of channels (1 = mono, 2 = stereo, ...)
Definition at line 253 of file SoundBuffer.cpp.
float sf::SoundBuffer::GetDuration | ( | ) | const |
Get the sound duration.
Definition at line 265 of file SoundBuffer.cpp.
unsigned int sf::SoundBuffer::GetSampleRate | ( | ) | const |
Get the sample rate.
Definition at line 241 of file SoundBuffer.cpp.
const Int16 * sf::SoundBuffer::GetSamples | ( | ) | const |
Return the sound samples.
Definition at line 223 of file SoundBuffer.cpp.
std::size_t sf::SoundBuffer::GetSamplesCount | ( | ) | const |
bool sf::SoundBuffer::LoadFromFile | ( | const std::string & | Filename | ) |
Load the sound buffer from a file.
Filename | : Path of the sound file to load |
Definition at line 88 of file SoundBuffer.cpp.
bool sf::SoundBuffer::LoadFromMemory | ( | const char * | Data, |
std::size_t | SizeInBytes | ||
) |
Load the sound buffer from a file in memory.
Data | : Pointer to the file data in memory |
SizeInBytes | : Size of the data to load, in bytes |
Definition at line 129 of file SoundBuffer.cpp.
bool sf::SoundBuffer::LoadFromSamples | ( | const Int16 * | Samples, |
std::size_t | SamplesCount, | ||
unsigned int | ChannelsCount, | ||
unsigned int | SampleRate | ||
) |
Load the sound buffer from an array of samples - 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 171 of file SoundBuffer.cpp.
SoundBuffer & sf::SoundBuffer::operator= | ( | const SoundBuffer & | Other | ) |
Assignment operator.
Other | : Instance to assign |
Definition at line 274 of file SoundBuffer.cpp.
bool sf::SoundBuffer::SaveToFile | ( | const std::string & | Filename | ) | const |
Save the sound buffer to a file.
Filename | : Path of the sound file to write |
Definition at line 199 of file SoundBuffer.cpp.