   (.resume (:current-sound @app-state/app-state))
   (swap! app-state/app-state assoc :paused? false))
 
+(defn get-duration []
+  (if (nil? (:current-sound @app-state/app-state))
+    0
+    (.-duration (:current-sound @app-state/app-state))))
+
+
 (defn load-track! [sound-url sound-id on-load-fn]
   (.createSound js/soundManager #js {:id sound-id
                                      :url sound-url

  (defn on-play []
    (if (nil? position)
      (.setPosition (:current-sound @app-state/app-state) (.-MAX_SAFE_INTEGER js/Number))))

  (.play (:current-sound @app-state/app-state)
               #js {:whileplaying while-playing
                    :onplay on-play
                    :from position})

  (println "POSITION:" position)
  (if (:paused? @app-state/app-state)

    0
    (.-position (:current-sound @app-state/app-state))))

(defn is-sound-loaded? []
  (not (nil? (:current-sound @app-state/app-state))))

