Page 1 of 1

Searching audio amplitude for a graphic audio interface.

Posted: 08 Apr 2005 14:07
by Ronald
I'm doing a graphic audio interface, representing audio amplitude in times, that i'll integrate with VLC.
I've found the audio volume (Pi_soft ), but is there audio amplitude in a type, a function, or a variable ?
(Audio_format_t) input doesn't comport audio amplitude...
Does VLC calculate the average of audio amplitude somewhere?
Thx to everybody who can help me.
++

Posted: 08 Apr 2005 15:46
by dionoea
you should look at the visualisation code source. I bet it uses the amplitude somewhere (in modules/visualisation in the VLC trunk)

same Problem

Posted: 18 Apr 2005 13:34
by CorteX
I ve built VLC, on a mac OSX.
I'm checking modules to find audio amplitude and any parameter on audio.
Someone may have an idea of how does VLC work on audio reading and if it's possible to extract amplitude (variable) or anything else.
I'm waiting for an answer, don't hesitate if you have an idea...
thx

help plz

Posted: 25 May 2005 16:14
by CorteX
Ok i've found some interesting things about amplitude.
In p_aout_instance, p_buffer has a place in all effects in visualization. But
the number, I print (p_buffer whois is a unsigned char* ) in a new windows, doesn't seem to be amplitude.
Does anybody knows the calcul I should do to convert p_buffer in an average of amplitude?
I really need help.

Posted: 26 May 2005 10:37
by CorteX
no one knows?

Posted: 27 May 2005 10:51
by Guest
ok, perhaps I ven't be clear.
I reformulated my question:
How to convert the variable p_buffer (p_aout->output.p_fifo->p_buffer) into a new variable, like i_amplitude. I_amplitude should show the amplitude like in spectrum effect (visualization) for a bargraphe.

I'm looking some fourcc documentation, but I don't find.

OH --please stay polite-- --please stay polite--...

Posted: 03 Jun 2005 10:49
by Guest
Look's like this is my topic.

you can post here if you want dam.... :roll:
OK I've found a solution for my prob. I post it if someone need it :



- First add in "typedef struct aout_output_t" a new part: int i_amplitude.

Then in effects.c (modules/visualization/visual). Write in the spectrum fonction:

(int i_value ;
int i_sas ;)

for(i = 0; i< i_nb_bands ; i = i+2)
{
i_sas = peaks + peaks[i+1];
i_value = i_value + i_sas;
}


i_amplitude = i_value ;

This will add all the peaks of the spectre in i_amplitude.
I've copy this fonction in the random fonction. Then, in the random fonction, i've get off all the lines, which don't serve for calculate i_amplitude. I don't matter random vizualisation.

Finally, I've done with interface builder a bargraphe, which depends of i_amplitude.

This is an way to do it. But you can ameliorate it easily.
++