'' ----------------------------------------------------------------------------
'' IrrKlang Wrapper for Imperative Languages - Freebasic Examples
'' Frank Dodd (2009)
'' ----------------------------------------------------------------------------
'' Example 02: Play a sound
'' This simple example starts the sounds engine and plays a single wav file
'' ----------------------------------------------------------------------------

'' ////////////////////////////////////////////////////////////////////////////
'' Includes for extension libraries
#include "IrrKlangWrapper.bi"

'' ////////////////////////////////////////////////////////////////////////////
'' global variables
DIM sound as irr_sound

'' ////////////////////////////////////////////////////////////////////////////
'' GDB debugger main() function

' start the irrklang sound engine
IrrKlangStart

' Play a sound
sound = IrrKlangPlay2D ( "./media/HelloWorld.wav", _
        IRR_KLANG_FALSE, IRR_KLANG_FALSE, IRR_KLANG_TRUE )

' Set the volume of the sound
IrrKlangSetVolume( sound, 0.25 )

? "Press 'Q' to end"
Do

Loop Until Inkey = "q" OR IrrKlangIsFinished( sound )

' release the sound freeing its resource
IrrReleaseSound ( sound )

' Stop the urrklang sound engine and release resources
IrrKlangStop
