(bind-func AudioBuffer_read_looped
(lambda (ab:AudioBuffer* frame chan)
(if (= chan 0)
(AudioBuffer_set_playhead ab (% frame (AudioBuffer_frames ab))))
(if (> frame (AudioBuffer_frames ab))
0.0
(pref (AudioBuffer_data ab)
(+ (* frame (AudioBuffer_channels ab)) chan)))))