vumonitor/vumonitor.cc
/// Evaluate Level.  If we observe uninterrupted 0 level checks for
/// more than m_timeout seconds, raises the flag.  As soon as sound
/// returns, lower the flag.
///
Evaluate Level.  If we observe uninterrupted 0 level checks for
more than m_timeout seconds, raises the flag.  As soon as sound
returns, lower the flag.
Evaluate Level . If we observe uninterrupted 0 level checks for more than m_timeout seconds raises the flag . As soon as sound returns lower the flag .
void VU_monitor::check_quiet()
{
    bool level_is_zero = (m_level==0.0);
    m_checks++;
    if (m_last_announce == VU_TOO_QUIET) {
        if (not level_is_zero) {    
            m_quiet_timer.stop();
            update_status(VU_DETECTED);
        } else {
            update_status(VU_TOO_QUIET); 
        }
        return;
    }
    if (level_is_zero) {
        m_quiet_timer.start();
        if (m_quiet_timer.expired()) {
            update_status(VU_TOO_QUIET);
        } else {
            update_status(VU_DETECTED); 
        }
    } else {
        m_quiet_timer.stop();
        update_status(VU_DETECTED); 
    }
}
void VU_monitor :: check_quiet ( ) { bool level_is_zero = ( m_level == 0.0 ) ; m_checks ++ ; if ( m_last_announce == VU_TOO_QUIET ) { if ( not level_is_zero ) { m_quiet_timer . stop ( ) ; update_status ( VU_DETECTED ) ; } else { update_status ( VU_TOO_QUIET ) ; } return ; } if ( level_is_zero ) { m_quiet_timer . start ( ) ; if ( m_quiet_timer . expired ( ) ) { update_status ( VU_TOO_QUIET ) ; } else { update_status ( VU_DETECTED ) ; } } else { m_quiet_timer . stop ( ) ; update_status ( VU_DETECTED ) ; } }
Evaluate Level.
Evaluate Level .
// saw some dBs: clear flag, reset timer // still too quiet... // vvvvvvvvvvvvvvv *Not* yet flagged as TOO_QUIET vvvvvvvvvvvvvvvvv // if (m_debug) { //     LOG_DEBUG(Lgr) << "level=0, starting quiet timer"; // } // time remains before we alarm // audio continues to be detected