#include <SoundBuffer.hpp>
Public Member Functions | |
sfSoundBuffer () | |
bool | LoadFromFile (const std::string &Filename) |
bool | LoadFromMemory (const sfInt16 *Samples, std::size_t SamplesCount, unsigned int ChannelsCount, unsigned int Frequency) |
bool | SaveToFile (const std::string &Filename) const |
bool | IsEmpty () const |
const std::vector< sfInt16 > & | GetSamples () const |
unsigned int | GetFrequency () const |
unsigned int | GetChannelsCount () const |
float | GetDuration () const |
Friends | |
class | sfSound |
class | sfSoundStream |
Definition at line 42 of file SoundBuffer.hpp.
sfSoundBuffer::sfSoundBuffer | ( | ) |
Default constructor
Definition at line 37 of file SoundBuffer.cpp.
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 48 of file SoundBuffer.cpp.
bool sfSoundBuffer::LoadFromMemory | ( | const sfInt16 * | Samples, | |
std::size_t | SamplesCount, | |||
unsigned int | ChannelsCount, | |||
unsigned int | Frequency | |||
) |
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, ...) | |
Frequency | : Frequency (number of samples to play per second) |
Definition at line 89 of file SoundBuffer.cpp.
Referenced by sfSoundBufferRecorder::GetBuffer().
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 122 of file SoundBuffer.cpp.
bool sfSoundBuffer::IsEmpty | ( | ) | const |
Tell if the sound buffer has been filled with audio data
Definition at line 149 of file SoundBuffer.cpp.
Referenced by sfSoundBufferRecorder::GetBuffer().
const std::vector< sfInt16 > & sfSoundBuffer::GetSamples | ( | ) | const |
Return the sound samples
Definition at line 158 of file SoundBuffer.cpp.
unsigned int sfSoundBuffer::GetFrequency | ( | ) | const |
Get the sound frequency
Definition at line 167 of file SoundBuffer.cpp.
unsigned int sfSoundBuffer::GetChannelsCount | ( | ) | const |
Return the number of channels (1 = mono, 2 = stereo, ...)
Definition at line 176 of file SoundBuffer.cpp.
float sfSoundBuffer::GetDuration | ( | ) | const |
Get the sound duration
Definition at line 185 of file SoundBuffer.cpp.