                 input-data
                 output-data]} @state]
     (cond
-      finished?   (plot-buffers sample-rate
+      finished?   (plot-buffers (count input-data)
                                 (gstring/format "Input (%d samples)"
                                                 (count input-data))
                                 input-data

            [goog.string :as gstring]
            [goog.string.format]
            [sablono.core :refer-macros [html]]
            [audio-utils.audio-chunker :as c]
            [audio-utils.gate :as g]
            [audio-utils.web-audio :as a]
            [audio-utils.viz :refer [linear-distribution
                                     plot-buffers
                                     sine-wave]]
            [cljs.core.async :refer [<! timeout]]))

(defn run-test

(defcard
  "A look-ahead gate with the following parameters, fed with a
   stream of 32768 samples linearly distributed from -1.0 to 1.0.
   Threshold -12dB, look-ahead 0ms, hold 0ms, RMS window 10ms."
  (fn [state owner]
    (gate-test state))
  {:worker  "gate-1.js"
   :data-fn (fn [sample-rate]
              (linear-distribution [-1.0 1.0] 32768))})
