Mercurial > audlegacy-plugins
view src/paranormal/beatdetect.c @ 188:0d826917c56f trunk
[svn] - 64-bit safety (pass 1 of 2)
author | nenolod |
---|---|
date | Thu, 02 Nov 2006 18:22:02 -0800 |
parents | 13955c70fbec |
children | 65c4d8591b4a |
line wrap: on
line source
#include "paranormal.h" int pn_is_new_beat(void) { /* quantize the average energy of the pcm_data for beat detection. */ int fftsum = ((pn_sound_data->pcm_data[0][0] + pn_sound_data->pcm_data[1][0]) >> 6); /* * if the energy's quantization is within this, trigger as a detected * beat, otherwise don't. */ return (fftsum >= 300 && fftsum <= 600) ? 1 : 0; }