Results 1 to 2 of 2

Thread: Determine loudness of input sound? QAudioInput

  1. #1
    Join Date
    Jan 2012
    Posts
    23
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Determine loudness of input sound? QAudioInput

    Hi there
    i am working at one part of my program where i need to get an audioinput from a microphone.
    i think that is not the most difficult but how can i determine how loud this soundsignal is? i have to tell the program that if the input volume is a defined time beneath a specific soundlevel it shall execute another function.
    How can i solve this? I am not a sound professional so how does the program know how loud a signal is?

    Greetz

  2. #2
    Join Date
    Apr 2008
    Posts
    104
    Thanks
    8
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Determine loudness of input sound? QAudioInput

    In digitial sound, you can measure the sound level by sample values (usually in floating point format) or decibells (with 0 dB as a louder sound level).
    To convert normalized "float" value to dB, try this:

    inline float float2db (float v)
    {
    if (v == 0)
    return 0;

    if (v > 0)
    return (float) 20 * log10 (v / 1.0);

    return (float) 20 * log10 (v / -1.0);
    }

Similar Threads

  1. What is needed to use the QAudioInput??
    By Gokulnathvc in forum Newbie
    Replies: 1
    Last Post: 16th March 2011, 11:48
  2. QAudioInput && QTcpSocket help !
    By Con Nít in forum Qt Programming
    Replies: 14
    Last Post: 4th March 2011, 09:03
  3. QAudioInput example strange behavior
    By m15ch4 in forum Qt Programming
    Replies: 0
    Last Post: 13th August 2010, 06:55
  4. QAudioInput and QtcpSocket help!!!
    By XavierQT in forum General Programming
    Replies: 1
    Last Post: 13th July 2010, 19:15
  5. Replies: 1
    Last Post: 4th December 2008, 15:37

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.