summaryrefslogtreecommitdiffstats
path: root/libaf/af_sinesuppress.c
diff options
context:
space:
mode:
Diffstat (limited to 'libaf/af_sinesuppress.c')
-rw-r--r--libaf/af_sinesuppress.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/libaf/af_sinesuppress.c b/libaf/af_sinesuppress.c
index b7ed277d7b..56f6076b5c 100644
--- a/libaf/af_sinesuppress.c
+++ b/libaf/af_sinesuppress.c
@@ -22,7 +22,7 @@
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
+#include <string.h>
#include <inttypes.h>
#include <math.h>
@@ -47,13 +47,13 @@ static af_data_t* play_s16(struct af_instance_s* af, af_data_t* data);
// Initialization and runtime control
static int control(struct af_instance_s* af, int cmd, void* arg)
{
- af_sinesuppress_t* s = (af_sinesuppress_t*)af->setup;
+ af_sinesuppress_t* s = (af_sinesuppress_t*)af->setup;
switch(cmd){
case AF_CONTROL_REINIT:{
// Sanity check
if(!arg) return AF_ERROR;
-
+
af->data->rate = ((af_data_t*)arg)->rate;
af->data->nch = 1;
#if 0
@@ -95,7 +95,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
return AF_UNKNOWN;
}
-// Deallocate memory
+// Deallocate memory
static void uninit(struct af_instance_s* af)
{
if(af->data)
@@ -111,7 +111,7 @@ static af_data_t* play_s16(struct af_instance_s* af, af_data_t* data)
register int i = 0;
int16_t *a = (int16_t*)data->audio; // Audio data
int len = data->len/2; // Number of samples
-
+
for (i = 0; i < len; i++)
{
double co= cos(s->pos);
@@ -143,14 +143,14 @@ static af_data_t* play_float(struct af_instance_s* af, af_data_t* data)
float *a = (float*)data->audio; // Audio data
int len = data->len/4; // Number of samples
float avg, l, r;
-
+
for (i = 0; i < len; i+=2)
{
avg = (a[i] + a[i + 1]) / 2;
-
+
/* l = avg + (s->mul * (a[i] - avg));
r = avg + (s->mul * (a[i + 1] - avg));*/
-
+
a[i] = af_softclip(l);
a[i + 1] = af_softclip(r);
}