sfSoundBuffer Class Reference

sfSoundBuffer is the low-level for loading and manipulating sound buffers More...

#include <SoundBuffer.hpp>

Inheritance diagram for sfSoundBuffer:

List of all members.

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.
sfSoundBufferoperator= (const sfSoundBuffer &Other)
 Assignment operator.

Friends

class sfSound

Detailed Description

sfSoundBuffer is the low-level for loading and manipulating sound buffers

Definition at line 41 of file SoundBuffer.hpp.


Constructor & Destructor Documentation

sfSoundBuffer::sfSoundBuffer (  ) 

Default constructor.

Definition at line 39 of file SoundBuffer.cpp.

sfSoundBuffer::sfSoundBuffer ( const sfSoundBuffer Copy  ) 

Copy constructor.

Parameters:
Copy : Instance to copy

Definition at line 51 of file SoundBuffer.cpp.

sfSoundBuffer::~sfSoundBuffer (  ) 

Destructor.

Definition at line 67 of file SoundBuffer.cpp.


Member Function Documentation

bool sfSoundBuffer::LoadFromFile ( const std::string &  Filename  ) 

Load the sound buffer from a file.

Parameters:
Filename : Path of the sound file to load
Returns:
True if loading has been successful

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.

Parameters:
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)
Returns:
True if loading has been successful

Definition at line 114 of file SoundBuffer.cpp.

bool sfSoundBuffer::SaveToFile ( const std::string &  Filename  )  const

Save the sound buffer to a file.

Parameters:
Filename : Path of the sound file to write
Returns:
True if saving has been successful

Definition at line 142 of file SoundBuffer.cpp.

const sfInt16 * sfSoundBuffer::GetSamples (  )  const

Return the sound samples.

Returns:
Pointer to the array of sound samples, in 16 bits signed integer format

Definition at line 168 of file SoundBuffer.cpp.

std::size_t sfSoundBuffer::GetSamplesCount (  )  const

Return the samples count.

Returns:
Number of samples

Definition at line 177 of file SoundBuffer.cpp.

unsigned int sfSoundBuffer::GetSampleRate (  )  const

Get the sample rate.

Returns:
Sound frequency (number of samples per second)

Definition at line 186 of file SoundBuffer.cpp.

unsigned int sfSoundBuffer::GetChannelsCount (  )  const

Return the number of channels (1 = mono, 2 = stereo, .

..)

Returns:
Number of channels

Definition at line 198 of file SoundBuffer.cpp.

float sfSoundBuffer::GetDuration (  )  const

Get the sound duration.

Returns:
Sound duration, in seconds

Definition at line 210 of file SoundBuffer.cpp.

sfSoundBuffer & sfSoundBuffer::operator= ( const sfSoundBuffer Other  ) 

Assignment operator.

Parameters:
Other : Instance to assign
Returns:
Reference to the sound buffer

Definition at line 219 of file SoundBuffer.cpp.


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