Browse Source

Added test for "brl.audio" (playing WAV and OGG)

Ronny Otto 11 years ago
parent
commit
a7e375ab06

+ 40 - 0
tests/framework/mod/brl/audio/audio_01.bmx

@@ -0,0 +1,40 @@
+Rem
+	This test checks:
+	- play sound
+End Rem
+SuperStrict
+Framework BRL.StandardIO
+Import BRL.Freeaudioaudio
+Import BRL.Audio
+Import BRL.WavLoader
+Import BRL.OggLoader
+Import BRL.Timer
+'SetAudioDriver("FreeAudio PulseAudio System")
+
+local timer:TTimer = CreateTimer(50)
+
+For local driver:string = eachin AudioDrivers()
+	print "available driver: "+driver
+Next
+
+local sound:TSound
+
+'try WAV
+sound = LoadSound("audio_01.wav")
+if sound
+	For local i:int = 0 to 2
+		WaitTimer(timer)
+		PlaySound(sound)
+	Next
+	print "wav sound played"
+endif
+
+'try OGG
+sound = LoadSound("audio_01.ogg")
+if sound
+	For local i:int = 0 to 2
+		WaitTimer(timer)
+		PlaySound(sound)
+	Next
+	print "ogg sound played"
+endif

BIN
tests/framework/mod/brl/audio/audio_01.ogg


BIN
tests/framework/mod/brl/audio/audio_01.wav