         (let [cur-time (current-time)]
           (if-not (< (- time cur-time) (* interval 2))
             (<! (async/timeout (* interval 1000)))))
-        (recur)))))
+        (recur))))
+  chan)
+
+(s/fdef consume-loop
+  :args (s/cat :interval ::time
+               :chan ::sound-point-chan)
+  :ret ::sound-point-chan)


(s/def ::context #(instance? AudioContext %))
(s/def ::node #(instance? js/AudioNode %))
(s/def ::node-gen (s/fspec :args #{[]} :ret ::node))
(s/def ::buffer #(instance? js/AudioBuffer %))
(s/def ::time (s/and number? pos?))

(defn decode-audio-data [buffer]
  {:pre [(s/valid? ::ss/array-buffer buffer)]}

;
;(s/def ::node-spec (s/multi-spec node-spec-type first))

(defn loop-chan [items start chan]
  {:pre [(s/valid? ::items-list items)
         (s/valid? ::time start)
         (s/valid? ::sound-point-chan chan)]}
  (go
    (loop [i 0
           t start]
