(bind-func audiofile_float_to_sample_be
(let ((tmp:i32* (zalloc 1)))
(lambda (src:i8* dest:SAMPLE* nsamp)
(doloop (i nsamp)
;; flip the byte order
(pset! tmp 0 (pref (cast src i32*) i))
(pset! tmp 0 (swapi32 (pref tmp 0)))
;; stuff it into dest
(pset! dest i (pref (cast tmp float*) 0))))))