I'm on the case!
I've had a torrid afternoon just trying to locate a (genuinely!!) looped sample on the internet which I could use to verify that I understood the .wav file format correctly.
Unless you want to turn into a crazed axe-weilding maniac, I wouldn't recommend this.
After two hours of swearing at the internet, I decided to download a (demo...) sample editor to create my own looped sample.
I tried 'Cool Edit' - ugh, awful.
I tried 'Acid WAV' - dreadful stuff.
I would have tried Sound Forge, but the demo has no save available.
I then remembered TWE! Thank you, Yamaha.
(Getting back on topic now...)
The .wav format is one of the most bastardised file formats in existence. It has had far too many independant programmers throwing half-assed ideas at it...I'm not going to try to support the imbedded IFF lists and other such nonsensical stuff.
I'll support genuine PCM-format .wav files, 16, 24 or 32 - bit resolution, any sample rate, 0 or 1 loops (if 0 loops, I'll consider the entire sample for the BPM calculation).
I should be able to knock this out in an evening - watch this space!
Royston
p.s. Mac users: I'll have to teach myself Java at some point!