How can I visualize sound through BASS.dll in Delphi?
Using ordinary canvas at least for drawing (without any spectrum, etc.)

I want to do something like this (instantaneous distribution of sound by frequency):

desired

  • @Kromster second - Legended
  • @ MSDN.WhiteKnight In the first question C #, in the second question about drawing the graph. - Legended
  • Check out this thread on the official library forum . Also in this forum thread a person is looking for a way how to display the audio output of the computer . There is also a promising line: With BASS I could display this by using BASS_ChannelGetData for a given audio file . Maybe something will do. - Dima
  • As you were correctly noted in the answer, the means for obtaining the FFT-representation of the audio channel is in the library itself. You must apply the BASS_ChannelGetData function, which BASS_ChannelGetData sample channel . I advise you to read this (there is an example of use there). Help the library is powerful. - Dima

1 answer 1

Do the Fourier transform to get the frequency spectrum. Perhaps, the means for this is in this very bass.dll

Then get the amplitude of the frequency spectrum as the root of the sum of the squares of the imaginary and real parts

Then add the amplitudes in several frequency bands — usually using a logarithmic frequency scale — for example, from 20 to 40 Hz, from 40 to 80, from 80 to 160, etc.

Print the resulting array in the form of rectangles, the height of which when outputting the level in decibels is proportional to the logarithm of the array element.

  • Um ... I would like a code example. What to do is understandable, but how ... is another question. - Legended
  • 2
    So write the code, show, we will help bring to mind - MBo