require '../src/ClanRuby'
include ClanRuby

#
# This sample shows how to play a simple wav file.
#
# Note that the clanlib sound support is still a bit flakey
#

#
# Initialize the core and sound libs.
#
SetupCore.init()
SetupSound.init()

#
# Read in the sound sample.
#
sam = Sample.new("bang.wav")

#
# Create the sound buffer.
#
sb = SoundBuffer.createFromStatic( sam );

#
# Play the sound.
#
sess = sb.play()

while sess.isPlaying()
	System.keepAlive(50)
end

#
# Clean up
#
SetupSound.deinit()
SetupCore.deinit()




