   (isa? (type bs) ::buffer-out-stream))
 
 (defn buffer-stream-close
-  "Close a buffer stream created with #'buffer-stream. Also frees the internal
-  buffer. Returns the path of the newly created file."
+  "Close a buffer stream created with #'buffer-stream. Also frees the
+  internal buffer. Returns the path of the newly created file."
   [buf-stream]
   (assert (file-buffer? buf-stream))
   (when-not @(:open? buf-stream)

           samples)))))

(defn buffer-write!
  "Write into a section of an audio buffer which modifies the buffer in place on
  the server. Data can either be a single number or a collection of numbers.
  Accepts an optional param start-idx which specifies an initial offset into the
  buffer from which to start writing the data (defaults to 0)."
  ([buf data] (buffer-write! buf 0 data))
  ([buf start-idx data]
     (assert (buffer? buf))

     (snd "/b_fill" (:id buf) start len (double val))))

(defn buffer-set!
  "Write a single value into a buffer. Modifies the buffer in place on
  the server. Index defaults to 0 if not specified."
  ([buf val] (buffer-set! buf 0 val))
  ([buf index val]
     (assert (buffer? buf))
