sfSoundBuffer Class Reference

#include <SoundBuffer.hpp>

List of all members.

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


Detailed Description

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

Definition at line 42 of file SoundBuffer.hpp.


Constructor & Destructor Documentation

sfSoundBuffer::sfSoundBuffer (  ) 

Default constructor

Definition at line 37 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 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

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

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

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

Definition at line 122 of file SoundBuffer.cpp.

bool sfSoundBuffer::IsEmpty (  )  const

Tell if the sound buffer has been filled with audio data

Returns:
True if the buffer is empty

Definition at line 149 of file SoundBuffer.cpp.

Referenced by sfSoundBufferRecorder::GetBuffer().

const std::vector< sfInt16 > & sfSoundBuffer::GetSamples (  )  const

Return the sound samples

Returns:
Array of sound samples, in 16 bits signed integer format

Definition at line 158 of file SoundBuffer.cpp.

unsigned int sfSoundBuffer::GetFrequency (  )  const

Get the sound frequency

Returns:
Sound frequency (number of samples per second)

Definition at line 167 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 176 of file SoundBuffer.cpp.

float sfSoundBuffer::GetDuration (  )  const

Get the sound duration

Returns:
Sound duration, in seconds

Definition at line 185 of file SoundBuffer.cpp.


The documentation for this class was generated from the following files:
Generated for SFML by  doxygen 1.5.2