(bind-func sf_samples_from_file
"get the total number of samples (* frames channels) from an audio file"
(lambda (filename)
(let ((info:SF_INFO* (salloc))
(audiofile (sf_open filename SFM_READ info)))
(if (null? audiofile)
-1
(begin
(sf_close audiofile)
(* (sf_frames info)
(convert (sf_channels info))))))))