Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Simple Spectrum analyzer with default windows stéreo-mixer as input
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 1.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    filipdns
    wrote on 13 Nov 2018, 18:14 last edited by
    #1

    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

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 13 Nov 2018, 18:49 last edited by
      #2

      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)

      F 1 Reply Last reply 13 Nov 2018, 19:06
      0
      • M mrjj
        13 Nov 2018, 18:49

        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)

        F Offline
        F Offline
        filipdns
        wrote on 13 Nov 2018, 19:06 last edited by
        #3

        @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..

        M 1 Reply Last reply 13 Nov 2018, 19:16
        0
        • F filipdns
          13 Nov 2018, 19:06

          @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..

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 13 Nov 2018, 19:16 last edited by
          #4

          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.

          F 1 Reply Last reply 14 Nov 2018, 07:41
          3
          • M mrjj
            13 Nov 2018, 19:16

            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.

            F Offline
            F Offline
            filipdns
            wrote on 14 Nov 2018, 07:41 last edited by
            #5

            @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.

            M J 2 Replies Last reply 14 Nov 2018, 07:53
            0
            • F filipdns
              14 Nov 2018, 07:41

              @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.

              M Offline
              M Offline
              mrjj
              Lifetime Qt Champion
              wrote on 14 Nov 2018, 07:53 last edited by
              #6

              @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

              1 Reply Last reply
              3
              • F filipdns
                14 Nov 2018, 07:41

                @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.

                J Offline
                J Offline
                JKSH
                Moderators
                wrote on 14 Nov 2018, 08:29 last edited by
                #7

                @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.

                Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                1 Reply Last reply
                3

                6/7

                14 Nov 2018, 07:53

                • Login

                • Login or register to search.
                6 out of 7
                • First post
                  6/7
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved