Commits

Anonymous committed 56b57a4

single channel for sfx, avoids running out of audio channels and crashing

Comments (0)

Files changed (1)

 
 (* sounds *)
 
+let sfx_play sfx = Sdlmixer.play_channel ~channel:0 sfx
+
 let sfx_step () =   
   let sfx = Sdlmixer.loadWAV "data/sfx/step.wav" in
-  Sdlmixer.play_sound sfx
+  sfx_play sfx
 
 let sfx_error () = 
   let sfx = Sdlmixer.loadWAV "data/sfx/failure.wav" in
-  Sdlmixer.play_sound sfx
+  sfx_play sfx
   
 let sfx_success () =   
   let sfx = Sdlmixer.loadWAV "data/sfx/success.wav" in
-  Sdlmixer.play_sound sfx
+  sfx_play sfx
   
 (* images *)