Simple Spectrum analyzer with default windows stéreo-mixer as input



  • Hello,

    Any one can help me to found a simple example of spectrum analyser for windows?

    I want add simple bars spectrum to my qml form when any sound is playing on my computer but I don't understand the qt example...

    Could you help me?

    Thank you very much


  • Qt Champions 2017

    Hi
    What about
    https://github.com/lanniaoershi/QtSpectrum
    ?
    Also , please understand that the "Spectrum analyzer" part
    is not trivial and hence a library is used. (fftreal)



  • @mrjj Hello thank you for the reply but the link give the same project of the example in Qt, then it's doesn't help me to understand how to use fftreal or fftw3..


  • Qt Champions 2017

    Hi
    Im not sure its same sample. GUI seems very different.
    Anyway, the fftreal lib is computing FFT which is an algorithm
    so any book or web page about it, will tell how it works.
    https://en.wikipedia.org/wiki/Fast_Fourier_transform
    For how to use the lib, you must resort to its docs.
    The readme.txt contains usage instructions.



  • @mrjj thank, I try to read information concerning fast fourier but I'm not mathematician, that why I'm looking for simple example with no need to open file but reading any sound emit from the pc.

    I don't understand why only .wav file are used on all example that I found on google or Qt.


  • Qt Champions 2017

    @filipdns
    Most likely to keep sample more simple.

    If you do FFT on a live stream, you will delay the
    sound unless you have a hardware device to do it.
    The FFT takes time to compute.
    So to counter this, a buffer is used to allow smooth(er) playback.
    However, the code for buffer just complicates sample so its easier just to do
    on a file.

    Regarding fftreal, the actual use seems just a few lines of code.
    https://github.com/cyrilcode/fft-real


  • Moderators

    @filipdns said in Simple Spectrum analyzer with default windows stéreo-mixer as input:

    I don't understand why only .wav file are used on all example that I found on google or Qt.

    Because it is easy to open .wav files and extract their waveform data.

    To get waveform data from your PC's hardware, you need to call your OS's multimedia API (like DirectSound or Windows Media Foundation) or use a cross-platform API like QAudioInput.

    To get waveform data from a compressed audio file (like .mp3, .flac, .ogg, etc.) you need to use a codec.

    Regardless of how you get the waveform data though, the method of processing them using fftreal/fftw is the same. That's why the examples just use the easiest way of getting waveform data -- the examples want to show you how to process the waveform, not how to obtain the waveform.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.