sdl-mixer added by saeftl on Fri Nov 1 16:31:44 2013

(use srfi-1 sdl-mixer posix posix-extras loop srfi-18)
(print (open-audio ))

(define (umpf soundfile freq volume howmany)
  (let ((sound (load-sample soundfile)))
    (mix-volume-chunk sound volume)
  (thread-start!
    (make-thread
      (lambda ()
        (if (not (eq? howmany 'inf))
          (loop with a = 0 while (< a howmany) do
                (begin
                  (sleep (/ 60 freq))
                  (play-sample sound)
                  (set! a (+ a 1)))))
        (loop do
              (begin
                (sleep (/ 60 freq))
                (play-sample sound))))))))

(change-directory "sounds")

(let ((tabla (load-sample "tambourine-classical-tap.wav"))
      (marimba (load-sample "MarimbaHardC4.wav")))
    (umpf "tambourine-classical-tap.wav" 60 80 20)
    (umpf "MarimbaHardC4.wav" 60 127 30))

(close-audio)