25#ifndef SFML_SOUNDBUFFER_HPP
26#define SFML_SOUNDBUFFER_HPP
31#include <SFML/System/Resource.hpp>
32#include <SFML/Audio/AudioResource.hpp>
103 bool LoadFromSamples(
const Int16* Samples, std::size_t SamplesCount,
unsigned int ChannelsCount,
unsigned int SampleRate);
113 bool SaveToFile(
const std::string& Filename)
const;
178 bool Update(
unsigned int ChannelsCount,
unsigned int SampleRate);
186 void AttachSound(Sound* Instance)
const;
194 void DetachSound(Sound* Instance)
const;
199 typedef std::set<Sound*> SoundList;
204 unsigned int myBuffer;
205 std::vector<Int16> mySamples;
207 mutable SoundList mySounds;
AudioResource()
Default constructor.
SoundBuffer()
Default constructor.
bool LoadFromFile(const std::string &Filename)
Load the sound buffer from a file.
bool SaveToFile(const std::string &Filename) const
Save the sound buffer to a file.
unsigned int GetSampleRate() const
Get the sample rate.
const Int16 * GetSamples() const
Return the sound samples.
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...
bool LoadFromMemory(const char *Data, std::size_t SizeInBytes)
Load the sound buffer from a file in memory.
std::size_t GetSamplesCount() const
Return the samples count.
float GetDuration() const
Get the sound duration.
unsigned int GetChannelsCount() const
Return the number of channels (1 = mono, 2 = stereo, ...).
Sound defines the properties of a sound such as position, volume, pitch, etc.