How to play or load sound?

BlitzMax Forums/BlitzMax Programming/How to play or load sound?

BBUser48(Posted 2016) [#1]
This might sounds silly, How do I play sounds, like in a simple breakout game? Is there a module for this task?


GreenVertical(Posted 2016) [#2]
No need for a module. The below should do the trick just to play a preexisting sound file.

'first load sound file into a variable
Global aSnd:TSound= LoadSoundFile("C:\soundfile.wav")

'now play it
PlaySound(aSnd)


xlsior(Posted 2016) [#3]
And if you want smaller files, use .ogg
(IIRC mp3 isn't supported natively, due to licensing costs)


Derron(Posted 2016) [#4]
mp3 will be free from january 2018 (in Europe it is already).


Do not forget to import the modules to be able to load ogg (if you use the framework command, else it is not needed).


bye
Ron