25 #ifndef SFML_SOUNDBUFFER_HPP
26 #define SFML_SOUNDBUFFER_HPP
31 #include <SFML/Audio/Export.hpp>
32 #include <SFML/Audio/AlResource.hpp>
33 #include <SFML/System/Time.hpp>
86 bool loadFromFile(
const std::string& filename);
102 bool loadFromMemory(
const void* data, std::size_t sizeInBytes);
135 bool loadFromSamples(
const Int16* samples, Uint64 sampleCount,
unsigned int channelCount,
unsigned int sampleRate);
150 bool saveToFile(
const std::string& filename)
const;
164 const Int16* getSamples()
const;
177 Uint64 getSampleCount()
const;
191 unsigned int getSampleRate()
const;
204 unsigned int getChannelCount()
const;
214 Time getDuration()
const;
249 bool update(
unsigned int channelCount,
unsigned int sampleRate);
257 void attachSound(
Sound* sound)
const;
265 void detachSound(
Sound* sound)
const;
270 typedef std::set<Sound*> SoundList;
275 unsigned int m_buffer;
276 std::vector<Int16> m_samples;
278 mutable SoundList m_sounds;
284 #endif // SFML_SOUNDBUFFER_HPP