audio_01.bmx 840 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. Rem
  2. This test checks:
  3. - play sound
  4. End Rem
  5. SuperStrict
  6. Framework BRL.StandardIO
  7. Import BRL.Freeaudioaudio
  8. Import BRL.Audio
  9. Import BRL.WavLoader
  10. Import BRL.OggLoader
  11. local soundFiles:string[] = ["audio_01.wav", "audio_01.ogg"]
  12. local channel:TChannel
  13. local sound:TSound
  14. 'loop through drivers
  15. For local driver:string = eachin AudioDrivers()
  16. 'default blitzmax modules have "null" driver which segfaults
  17. '-> skip it
  18. if driver.ToLower() = "null" then continue
  19. print "Trying Audio Driver: "+driver
  20. SetAudioDriver(driver)
  21. For local f:string = EachIn soundFiles
  22. sound = LoadSound(f)
  23. if not sound
  24. print " loading of ~q"+f+"~q failed."
  25. continue
  26. endif
  27. print "playing: "+f
  28. channel = PlaySound(sound)
  29. While channel.Playing()
  30. delay(10)
  31. Wend
  32. print "stopped: "+f
  33. Next
  34. Next