aboutsummaryrefslogtreecommitdiff
path: root/src/scalar.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/scalar.c')
-rw-r--r--src/scalar.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/scalar.c b/src/scalar.c
index 612fa3c..49c4408 100644
--- a/src/scalar.c
+++ b/src/scalar.c
@@ -291,14 +291,17 @@ int xtract_rolloff(const float *data, const int N, const void *argv, float *resu
int xtract_loudness(const float *data, const int N, const void *argv, float *result){
- int n = BARK_BANDS;
+ int n = N, rv;
- /*if(n != N) return BAD_VECTOR_SIZE; */
+ if(n > BARK_BANDS)
+ rv = BAD_VECTOR_SIZE;
+ else
+ rv = SUCCESS;
while(n--)
*result += pow(data[n], 0.23);
- return SUCCESS;
+ return rv;
}
int xtract_flatness(const float *data, const int N, const void *argv, float *result){