From 22079050f23cd4e019fc7dc98c25d5e06b1f8ead Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Fri, 8 Jun 2012 22:49:38 +0000 Subject: Bon, la détection de volume commence à ressembler à qque chose mais les valeurs semblent pas forcément bonnes. Le filtre A n'est pas appliqué encore. Dans le test6, quelques essais de maths... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///var/svn/2012-violon-leds/trunk@14 6be1fa4d-33ac-4c33-becc-79fcb3794bb6 --- tests/test5/TOREAD | 2 ++ tests/test5/capture.c | 2 -- tests/test5/compute.c | 26 ++++++++++++-------------- tests/test5/test5.c | 4 ++-- tests/test5/win_main.c | 2 ++ 5 files changed, 18 insertions(+), 18 deletions(-) (limited to 'tests/test5') diff --git a/tests/test5/TOREAD b/tests/test5/TOREAD index e84ab7e..acb1aca 100644 --- a/tests/test5/TOREAD +++ b/tests/test5/TOREAD @@ -1,2 +1,4 @@ http://freedesktop.org/software/pulseaudio/doxygen/async.html#overv_sec +http://www.developpez.net/forums/d467150/autres-langages/algorithmes/fft-role/ + diff --git a/tests/test5/capture.c b/tests/test5/capture.c index 00d9c54..26d345c 100644 --- a/tests/test5/capture.c +++ b/tests/test5/capture.c @@ -195,8 +195,6 @@ void stream_read_callback(pa_stream *s, size_t nbytes, void *userdata) { //printf("debug : before call capture_sound_level_cb==%p\n", capture_sound_level_cb); my_process((float *)p,nbytes/sizeof(float), pa_stream_get_sample_spec(s)->channels); -// (*capture_sound_level_cb)(compute_level(p,nbytes), NULL); - //printf("debug : after call capture_sound_level_cb==%p\n", capture_sound_level_cb); pa_stream_drop(s); diff --git a/tests/test5/compute.c b/tests/test5/compute.c index 2658904..3a94efe 100644 --- a/tests/test5/compute.c +++ b/tests/test5/compute.c @@ -9,7 +9,7 @@ gfloat compute_level(const float *data, size_t nsamples, size_t nchan) { double rate=44100; //TODO dynamique size_t i; - float input[MAX_SAMPLES], output[MAX_SAMPLES]; + float input[MAX_SAMPLES], output[128]; float level; if (nsamples >= MAX_SAMPLES) { @@ -33,25 +33,23 @@ gfloat compute_level(const float *data, size_t nsamples, size_t nchan) { // printf("\n"); compute_spectrom(input, nsamples, rate, output); - - level=0; - for (i=0;i