How to play or load sound?
BlitzMax Forums/BlitzMax Programming/How to play or load sound?
| ||
This might sounds silly, How do I play sounds, like in a simple breakout game? Is there a module for this task? |
| ||
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) |
| ||
And if you want smaller files, use .ogg (IIRC mp3 isn't supported natively, due to licensing costs) |
| ||
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 |