tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

energy_endpointer_params.cc (3246B)


      1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
      2 //
      3 // Redistribution and use in source and binary forms, with or without
      4 // modification, are permitted provided that the following conditions are
      5 // met:
      6 //
      7 //    * Redistributions of source code must retain the above copyright
      8 // notice, this list of conditions and the following disclaimer.
      9 //    * Redistributions in binary form must reproduce the above
     10 // copyright notice, this list of conditions and the following disclaimer
     11 // in the documentation and/or other materials provided with the
     12 // distribution.
     13 //    * Neither the name of Google Inc. nor the names of its
     14 // contributors may be used to endorse or promote products derived from
     15 // this software without specific prior written permission.
     16 //
     17 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     18 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     19 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     20 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     21 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     22 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
     23 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     24 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     25 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     26 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     27 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     28 
     29 #include "energy_endpointer_params.h"
     30 
     31 namespace mozilla {
     32 
     33 EnergyEndpointerParams::EnergyEndpointerParams() {
     34  SetDefaults();
     35 }
     36 
     37 void EnergyEndpointerParams::SetDefaults() {
     38  frame_period_ = 0.01f;
     39  frame_duration_ = 0.01f;
     40  endpoint_margin_ = 0.2f;
     41  onset_window_ = 0.15f;
     42  speech_on_window_ = 0.4f;
     43  offset_window_ = 0.15f;
     44  onset_detect_dur_ = 0.09f;
     45  onset_confirm_dur_ = 0.075f;
     46  on_maintain_dur_ = 0.10f;
     47  offset_confirm_dur_ = 0.12f;
     48  decision_threshold_ = 150.0f;
     49  min_decision_threshold_ = 50.0f;
     50  fast_update_dur_ = 0.2f;
     51  sample_rate_ = 8000.0f;
     52  min_fundamental_frequency_ = 57.143f;
     53  max_fundamental_frequency_ = 400.0f;
     54  contamination_rejection_period_ = 0.25f;
     55 }
     56 
     57 void EnergyEndpointerParams::operator=(const EnergyEndpointerParams& source) {
     58  frame_period_ = source.frame_period();
     59  frame_duration_ = source.frame_duration();
     60  endpoint_margin_ = source.endpoint_margin();
     61  onset_window_ = source.onset_window();
     62  speech_on_window_ = source.speech_on_window();
     63  offset_window_ = source.offset_window();
     64  onset_detect_dur_ = source.onset_detect_dur();
     65  onset_confirm_dur_ = source.onset_confirm_dur();
     66  on_maintain_dur_ = source.on_maintain_dur();
     67  offset_confirm_dur_ = source.offset_confirm_dur();
     68  decision_threshold_ = source.decision_threshold();
     69  min_decision_threshold_ = source.min_decision_threshold();
     70  fast_update_dur_ = source.fast_update_dur();
     71  sample_rate_ = source.sample_rate();
     72  min_fundamental_frequency_ = source.min_fundamental_frequency();
     73  max_fundamental_frequency_ = source.max_fundamental_frequency();
     74  contamination_rejection_period_ = source.contamination_rejection_period();
     75 }
     76 
     77 }  //  namespace mozilla