I would like to produce a simple (real time) graph of the spectrum of a sound that i record with uos.
I am using an Raspberry 3 (Raspbian Jessie sept 2017) and a usb sound card. All examples work perfect.
I cant find a way to assess the freq data during recording.
function uos_InputAddFilter(PlayerIndex: cint32; InputIndex: cint32; LowFrequency: cint32;
HighFrequency: cint32; Gain: cfloat; TypeFilter: cint32;
AlsoBuf: boolean; Proc: TProc): cint32 ;
// PlayerIndex : Index of a existing Player
// InputIndex : InputIndex of a existing Input
// LowFrequency : Lowest frequency of filter
// HighFrequency : Highest frequency of filter
// Gain : gain to apply to filter
// TypeFilter: Type of filter : default = -1 = fBandSelect (fBandAll = 0, fBandSelect = 1, fBandReject = 2
// fBandPass = 3, fHighPass = 4, fLowPass = 5)
// AlsoBuf : The filter alter buffer aswell ( otherwise, only result is filled in fft.data )
// LoopProc : External procedure to execute after DSP done
// result : index of DSPIn in array -1 = error
IMHO, you may apply a filter fBandSelect for each frequency you want to mesure and see the level resulting.
And set AlsoBuf to false so the sound will not be affected but filled in fft.data ---> use the result in fft.data.
Maybe try filterplayer demos to give you some ideas.
OS Linux, Lazarus 2.0.2.
Yes, I tried your example, it works. But I wanted to get exactly the FFT readings in order to reflect them on the graph as a spectrogram. Your example, however, only shows the signal levels in the filters and does not have the fft.data property.
Thanks for the prompt replies.