25#ifndef SFML_SOUNDBUFFER_HPP
26#define SFML_SOUNDBUFFER_HPP
141 bool loadFromSamples(
const Int16* samples, std::size_t sampleCount,
unsigned int channelCount,
unsigned int sampleRate);
245 bool initialize(priv::SoundFile& file);
256 bool update(
unsigned int channelCount,
unsigned int sampleRate);
264 void attachSound(
Sound* sound)
const;
272 void detachSound(
Sound* sound)
const;
277 typedef std::set<Sound*> SoundList;
282 unsigned int m_buffer;
283 std::vector<Int16> m_samples;
285 mutable SoundList m_sounds;
SoundBuffer()
Default constructor.
unsigned int getChannelCount() const
Get the number of channels used by the sound.
Time getDuration() const
Get the total duration of the sound.
bool loadFromFile(const std::string &filename)
Load the sound buffer from a file.
unsigned int getSampleRate() const
Get the sample rate of the sound.
std::size_t getSampleCount() const
Get the number of samples stored in the buffer.
const Int16 * getSamples() const
Get the array of audio samples stored in the buffer.
bool loadFromSamples(const Int16 *samples, std::size_t sampleCount, unsigned int channelCount, unsigned int sampleRate)
Load the sound buffer from an array of audio samples.
bool saveToFile(const std::string &filename) const
Save the sound buffer to an audio file.
SoundBuffer(const SoundBuffer ©)
Copy constructor.
bool loadFromStream(InputStream &stream)
Load the sound buffer from a custom stream.
~SoundBuffer()
Destructor.
bool loadFromMemory(const void *data, std::size_t sizeInBytes)
Load the sound buffer from a file in memory.
Regular sound that can be played in the audio environment.