         :path path
         :start start
         :open? (atom true))
-      {:type ::buffer-cue})))
-
-(derive ::buffer-cue ::buffer)
-
-(defn buffer-cue?
+      {:type ::buffer-in-stream})))
+
+(derive ::buffer-in-stream ::file-buffer)
+
+(defn buffer-in-stream?
   [bc]
-  (isa? (type bc) ::buffer-cue))
+  (isa? (type bc) ::buffer-in-stream))
 
 (defn buffer-cue-pos
   "Moves the start position of a buffer cue to the frame indicated by

  [buf]
  (isa? (type buf) ::buffer))

(defn buffer-free
  "Synchronously free an audio buffer and the memory it was consuming."
  [buf]

      (assoc buf
        :path path
        :open? (atom true))
      {:type ::buffer-out-stream})))

(derive ::buffer-out-stream ::file-buffer)

(defn buffer-out-stream?
  [bs]
  (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."
  [buf-stream]
  (assert (file-buffer? buf-stream))
  (when-not @(:open? buf-stream)
    (throw (Exception. "buffer-stream already closed.")))

