Qt audio loudness level

  • Hi.
    How can I meter loudness level of a streaming voice from microphone by qt? Is it that what I want?

    audioRecorder = new QAudioRecorder;
    QAudioEncoderSettings audioSettings;
    audioProbe = new QAudioProbe(this);
    if (audioProbe->setSource(audioRecorder)) {
    // Probing succeeded, audioProbe->isValid() should be true.
    connect(audioProbe, SIGNAL(audioBufferProbed(QAudioBuffer)),
            this, SLOT(calculateLevel(QAudioBuffer)));

    And whats the output of this code? What audio standard(decibel or others) is its output?


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    AFAIK, there's only one standard to measure audio loudness it's decibel but you have to calculate that yourself.

    You have all the information available through the QAudioBuffer class in order to calculate that.

  • Tnx but could you tell me how can I calculate it(stream audio) as decibel by this class?
    I'm an absolute beginner.tnx

  • Qt Champions 2017

    You have access to the raw buffer
    that has a given volume/loudness so its not exact science but you can google
    around for various ways ( sorry, not sound expert so cant give any concrete solution)

Log in to reply

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