diff options
Diffstat (limited to 'streamer.c')
-rw-r--r-- | streamer.c | 18 |
1 files changed, 2 insertions, 16 deletions
@@ -47,6 +47,7 @@ #include "premix.h" #include "ringbuf.h" #include "replaygain.h" +#include "fft.h" //#define trace(...) { fprintf(stderr, __VA_ARGS__); } #define trace(fmt,...) @@ -2002,16 +2003,6 @@ streamer_read_async (char *bytes, int size) { return bytesread; } -void rdft(int, int, float *, int *, float *); -static void do_fft(int n,float *x) -{ - static int ipsize = 0,wsize=0; - static int ip[18]; - static float w[256]; - - rdft(n,1,x,ip,w); -} - int streamer_read (char *bytes, int size) { #if 0 @@ -2093,12 +2084,7 @@ streamer_read (char *bytes, int size) { pcm_convert (&output->fmt, bytes + sz - DDB_AUDIO_MEMORY_FRAMES * in_frame_size, &out_fmt, (char *)audio_data, DDB_AUDIO_MEMORY_FRAMES * in_frame_size); } - memcpy (freq_data, audio_data, sizeof (audio_data)); - int N = DDB_AUDIO_MEMORY_FRAMES; - do_fft(N, freq_data); - for (int n = 0; n < N / 2 - 1; n ++) - freq_data[n] = 2 * fabs (freq_data[1 + n]) / N; - freq_data[N / 2 - 1] = fabs(freq_data[N / 2]) / N; + calc_freq (audio_data, freq_data); mutex_unlock (audio_mem_mutex); |