         (let [reader (new js/FileReader)
               blob   (get (:music-files @app-state) (.-id stream))]
           (.readAsDataURL reader blob)
+          (if-not (is-music-playing?)
           (set! (.-onloadend reader)
             (fn []
-              (request-new-file)
-              (swap! app-state assoc :file-downloading? false)
-              (.attr (js/$ "#current-track") "src" (.-result reader))
-              (.load (.getElementById js/document "audio-tag"))
-              (.play (.getElementById js/document "audio-tag"))
-              (println (str "Number of music files downloaded "
-                            (count (:music-files @app-state)))))))))))
+                (request-new-file)
+                (swap! app-state assoc :file-downloading? false)
+                (.attr (js/$ "#current-track") "src" (.-result reader))
+                (.load (.getElementById js/document "audio-tag"))
+                (.play (.getElementById js/document "audio-tag"))
+                (println (str "Number of music files downloaded "
+                              (count (:music-files @app-state))))))))))))
 
 (.change (js/$ "#file_upload_input")
   (fn [e]

      (.emit (js/ss socket) "file" stream)
      (.pipe blob-stream stream))))


      (+ 1 (:num-of-queued-requests @app-state))
      :else (request-new-file))))

(defn is-music-playing? []
  (not (.-paused (.getElementById js/document "audio-tag"))))

(.on (new js/ss socket) "file-to-client"
  (fn [stream]
    (swap! app-state assoc :file-downloading? true)
