SoundBuffer.h File Reference

#include <SFML/Config.h>
#include <SFML/Audio/Types.h>

Go to the source code of this file.


Functions

CSFML_API sfSoundBuffersfSoundBuffer_CreateFromFile (const char *Filename)
 Create a new sound buffer and load it from a file.
CSFML_API sfSoundBuffersfSoundBuffer_CreateFromMemory (const char *Data, size_t SizeInBytes)
 Create a new sound buffer and load it from a file in memory.
CSFML_API sfSoundBuffersfSoundBuffer_CreateFromSamples (const sfInt16 *Samples, size_t SamplesCount, unsigned int ChannelsCount, unsigned int SampleRate)
 Create a new sound buffer and load it from an array of samples in memory - assumed format for samples is 16 bits signed integer.
CSFML_API void sfSoundBuffer_Destroy (sfSoundBuffer *SoundBuffer)
 Destroy an existing sound buffer.
CSFML_API sfBool sfSoundBuffer_SaveToFile (sfSoundBuffer *SoundBuffer, const char *Filename)
 Save a sound buffer to a file.
CSFML_API const sfInt16 * sfSoundBuffer_GetSamples (sfSoundBuffer *SoundBuffer)
 Return the samples contained in a sound buffer.
CSFML_API size_t sfSoundBuffer_GetSamplesCount (sfSoundBuffer *SoundBuffer)
 Return the number of samples contained in a sound buffer.
CSFML_API unsigned int sfSoundBuffer_GetSampleRate (sfSoundBuffer *SoundBuffer)
 Get the sample rate of a sound buffer.
CSFML_API unsigned int sfSoundBuffer_GetChannelsCount (sfSoundBuffer *SoundBuffer)
 Return the number of channels of a sound buffer (1 = mono, 2 = stereo, .
CSFML_API float sfSoundBuffer_GetDuration (sfSoundBuffer *SoundBuffer)
 Get the duration of a sound buffer.

Function Documentation

CSFML_API sfSoundBuffer* sfSoundBuffer_CreateFromFile ( const char *  Filename  ) 

Create a new sound buffer and load it from a file.

Parameters:
Filename : Path of the music file to open
Returns:
A new sfSoundBuffer object (NULL if failed)

CSFML_API sfSoundBuffer* sfSoundBuffer_CreateFromMemory ( const char *  Data,
size_t  SizeInBytes 
)

Create a new sound buffer and load it from a file in memory.

Parameters:
Data : Pointer to the file data in memory
SizeInBytes : Size of the data to load, in bytes
Returns:
A new sfSoundBuffer object (NULL if failed)

CSFML_API sfSoundBuffer* sfSoundBuffer_CreateFromSamples ( const sfInt16 *  Samples,
size_t  SamplesCount,
unsigned int  ChannelsCount,
unsigned int  SampleRate 
)

Create a new sound buffer and load it from an array of samples in 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:
A new sfSoundBuffer object (NULL if failed)

CSFML_API void sfSoundBuffer_Destroy ( sfSoundBuffer SoundBuffer  ) 

Destroy an existing sound buffer.

Parameters:
SoundBuffer : Sound buffer to delete

CSFML_API unsigned int sfSoundBuffer_GetChannelsCount ( sfSoundBuffer SoundBuffer  ) 

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

..)

Parameters:
SoundBuffer : Sound buffer to get channels count from
Returns:
Number of channels

CSFML_API float sfSoundBuffer_GetDuration ( sfSoundBuffer SoundBuffer  ) 

Get the duration of a sound buffer.

Parameters:
SoundBuffer : Sound buffer to get duration from
Returns:
Sound duration, in seconds

CSFML_API unsigned int sfSoundBuffer_GetSampleRate ( sfSoundBuffer SoundBuffer  ) 

Get the sample rate of a sound buffer.

Parameters:
SoundBuffer : Sound buffer to get sample rate from
Returns:
Sound frequency (number of samples per second)

CSFML_API const sfInt16* sfSoundBuffer_GetSamples ( sfSoundBuffer SoundBuffer  ) 

Return the samples contained in a sound buffer.

Parameters:
SoundBuffer : Sound buffer to get samples from
Returns:
Pointer to the array of sound samples, in 16 bits signed integer format

CSFML_API size_t sfSoundBuffer_GetSamplesCount ( sfSoundBuffer SoundBuffer  ) 

Return the number of samples contained in a sound buffer.

Parameters:
SoundBuffer : Sound buffer to get samples count from
Returns:
Number of samples

CSFML_API sfBool sfSoundBuffer_SaveToFile ( sfSoundBuffer SoundBuffer,
const char *  Filename 
)

Save a sound buffer to a file.

Parameters:
SoundBuffer : Sound buffer to save
Filename : Path of the sound file to write
Returns:
sfTrue if saving has been successful