--- /dev/null
+/* $Id$
+
+This file is part of libmspal
+Copyright © 2008 Mikko Rasa, Mikkosoft Productions
+Diestributed under the LGPL
+*/
+
+#include "buffer.h"
+#include "sound.h"
+
+using namespace std;
+
+namespace Msp {
+namespace AL {
+
+Buffer::Buffer()
+{
+ alGenBuffers(1, &id);
+}
+
+Buffer::~Buffer()
+{
+ alDeleteBuffers(1, &id);
+}
+
+void Buffer::data(Format fmt, const void *dt, sizei size, sizei freq)
+{
+ alBufferData(id, fmt, dt, size, freq);
+}
+
+void Buffer::load_data(const string &fn)
+{
+ Sound sound;
+ sound.load(fn);
+
+ data(sound.get_format(), sound.get_data(), sound.get_size(), sound.get_frequency());
+}
+
+} // namespace AL
+} // namespace Msp