 (s/fdef play
   :args (s/cat :sound ::sound-point))
 
-(s/def ::sound-point
-  (s/and (s/keys :req [::time] :opt [::node ::node-gen])
-         #(some #{::node ::node-gen} (keys %))))
-
 ;; node-spec
 
 ;(defmulti node-spec-type first)

        (let [cur-time (current-time)]
          (if-not (< (- time cur-time) (* interval 2))
            (<! (async/timeout (* interval 1000)))))
        (recur)))))


(s/def ::context #(instance? AudioContext %))
(s/def ::node #(instance? js/AudioNode %))
(s/def ::node-gen (s/fspec :args (s/cat) :ret ::node))
(s/def ::buffer #(instance? js/AudioBuffer %))
(s/def ::time (s/and number? pos?))
(s/def ::sound-point
  (s/and (s/keys :req [::time] :opt [::node ::node-gen])
         #(some #{::node ::node-gen} (keys %))))
(s/def ::sound-point-chan (ss/chan-of ::sound-point))
(s/def ::items-list
  (s/+ (s/cat :node-gens (s/+ ::node-gen)
              :interval ::time)))

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