Hi all, I need to grab some resources from the server (sound files) and load them up.
The function I'm feeding them to (.decodeAudioData on an AudioContext) requires that these files be in the form of an "arraybuffer". I experimented with cljs-ajax [https://github.com/JulianBirch/cljs-ajax] but was unable to use its GET method to request data as an arraybuffer. Instead I wrote the following helper function: (defn GET-array-buffer [path callback] (let [request (js/XMLHttpRequest.)] (.open request "GET" path true) (set! (.-responseType request) "arraybuffer") (set! (.-onload request) (fn [] (callback (.-response request)))) (.send request))) Is there a way to get cljs-ajax or a similar library to do this? I'd prefer not to talk to XMLHttpRequest's myself if I can avoid it. Many thanks, Tristan -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/clojurescript.
