       (.emit socket "file-download-request" id))))
 
 (defn pause []
-  (.pause js/soundManager current-sound-id)
+  (.pause (:current-sound @app-state))
   (.emit socket "pause" (.-position (:current-sound @app-state))))
 
 (defn resume []


(defonce room-id (.getAttribute (. js/document (getElementById "roomid")) "data"))
(defonce socket (js/io))
(defonce current-sound-id "current-song")
(defonce default-upload-slots 4)
(defonce default-download-slots 4)
(defonce app-state (atom {:signed-in? false


(.on socket "pause"
  (fn [position]
    (.pause (:current-sound @app-state))
    (.setPosition (:current-sound @app-state) position)))

(.on socket "resume"
  (fn []
    (.resume (:current-sound @app-state))))

(.on socket "position-change"
  (fn [position]
    (letfn [(set-pos [position]
              (.setPosition (:current-sound @app-state) position))]
      (println "Received pos: " position)
      (if (= 0 (.-playState (:current-sound @app-state)))
        (.play (:current-sound @app-state)
