Mercurial > audlegacy-plugins
view src/paranormal/beatdetect.c @ 585:2d20bc58a290 trunk
[svn] tweak xspf plugin to conform xspf specification version 1.
- arrange the order of elements to pass several validators.
- specify character set and encoding as UTF-8.
- now urls beginning with file:// can be used.
- prepend file:// onto local file entry to save (tentative).
author | yaz |
---|---|
date | Tue, 30 Jan 2007 23:14:02 -0800 |
parents | 65c4d8591b4a |
children | 3b034150d31e |
line wrap: on
line source
#include "paranormal.h" /* * This algorithm is by Janusz Gregorcyzk, the implementation is * mine, however. * * -- nenolod */ int pn_is_new_beat(void) { gint i; gint total = 0; gboolean ret = FALSE; static gint previous; for (i = 1; i < 512; i++) { total += abs (pn_sound_data->pcm_data[0][i] - pn_sound_data->pcm_data[0][i - 1]); } total /= 512; ret = (total > (2 * previous)); previous = total; return ret; }