 
 (defn- load-sample*
   [path & args]
-  (let [id       (alloc-id :audio-buffer)
-        arg-map  (apply hash-map args)
-        start    (get arg-map :start 0)
-        n-frames (get arg-map :n-frames 0)]
-    (with-server-sync  #(snd "/b_allocRead" id path start n-frames))
-    (let [info   (buffer-info id)
-          sample (with-meta {:allocated-on-server (atom true)
-                             :id id
-                             :path path
-                             :size (:n-frames info)
-                             :rate (:rate info)
-                             :n-channels (:n-channels info)}
-                   {:type ::sample})]
-      (dosync (alter loaded-samples* assoc [path args] sample))
-      sample)))
+  (let [f (file path)]
+    (when-not (.exists f)
+      (throw (Exception. (str "Unable to load sample - file does not exist: " path))))
+    (let [f-name (.getName f)
+          id       (alloc-id :audio-buffer)
+          arg-map  (apply hash-map args)
+          start    (get arg-map :start 0)
+          n-frames (get arg-map :n-frames 0)]
+      (with-server-sync  #(snd "/b_allocRead" id path start n-frames))
+      (let [info   (buffer-info id)
+            sample (with-meta {:allocated-on-server (atom true)
+                               :id id
+                               :path path
+                               :name f-name
+                               :size (:n-frames info)
+                               :rate (:rate info)
+                               :n-channels (:n-channels info)}
+                     {:type ::sample})]
+        (dosync (alter loaded-samples* assoc [path args] sample))
+        sample))))
 
 (defn load-sample
   "Synchronously load a wav file into a memory buffer.  Returns the buffer.

  (dosync (alter loaded-samples* assoc [path args] nil))
  (if (connected?)
    (apply load-sample* path args)))

(defn- load-all-samples []
  (doseq [[[path args] buf] @loaded-samples*]

  ^{:doc "Making it easy to load and play audio samples (wav or aif files)."
     :author "Jeff Rose"}
  overtone.sc.sample
  (:use [clojure.java.io :only [file]]
        [overtone.util lib]
        [overtone.libs event deps]
        [overtone.sc.machinery allocator]
        [overtone.sc.machinery.server comms]
        [overtone.sc server synth ugens buffer]
        [overtone.helpers.file :only [glob]]))

; Define a default wav player synth
(defonce __DEFINE-PLAYERS__
