| Index: content/browser/speech/speech_recognizer_impl.cc
|
| diff --git a/content/browser/speech/speech_recognizer_impl.cc b/content/browser/speech/speech_recognizer_impl.cc
|
| index 305dcaac9f0ff3a0d72516d2b8a0c5831eb0393c..273187d4b76903900f615e06acf471da2f52fa45 100644
|
| --- a/content/browser/speech/speech_recognizer_impl.cc
|
| +++ b/content/browser/speech/speech_recognizer_impl.cc
|
| @@ -4,9 +4,12 @@
|
|
|
| #include "content/browser/speech/speech_recognizer_impl.h"
|
|
|
| -#include "base/basictypes.h"
|
| +#include <stdint.h>
|
| +
|
| #include "base/bind.h"
|
| +#include "base/macros.h"
|
| #include "base/time/time.h"
|
| +#include "build/build_config.h"
|
| #include "content/browser/browser_main_loop.h"
|
| #include "content/browser/media/media_internals.h"
|
| #include "content/browser/speech/audio_buffer.h"
|
| @@ -69,9 +72,10 @@ namespace {
|
| const float kUpSmoothingFactor = 1.0f;
|
| // Multiplier used when new volume is lesser than previous level.
|
| const float kDownSmoothingFactor = 0.7f;
|
| -// RMS dB value of a maximum (unclipped) sine wave for int16 samples.
|
| +// RMS dB value of a maximum (unclipped) sine wave for int16_t samples.
|
| const float kAudioMeterMaxDb = 90.31f;
|
| -// This value corresponds to RMS dB for int16 with 6 most-significant-bits = 0.
|
| +// This value corresponds to RMS dB for int16_t with 6 most-significant-bits =
|
| +// 0.
|
| // Values lower than this will display as empty level-meter.
|
| const float kAudioMeterMinDb = 30.0f;
|
| const float kAudioMeterDbRange = kAudioMeterMaxDb - kAudioMeterMinDb;
|
| @@ -82,7 +86,7 @@ const float kAudioMeterRangeMaxUnclipped = 47.0f / 48.0f;
|
| // Returns true if more than 5% of the samples are at min or max value.
|
| bool DetectClipping(const AudioChunk& chunk) {
|
| const int num_samples = chunk.NumSamples();
|
| - const int16* samples = chunk.SamplesData16();
|
| + const int16_t* samples = chunk.SamplesData16();
|
| const int kThreshold = num_samples / 20;
|
| int clipping_samples = 0;
|
|
|
| @@ -196,7 +200,7 @@ SpeechRecognizerImpl::SpeechRecognizerImpl(
|
| } else {
|
| // In continuous recognition, the session is automatically ended after 15
|
| // seconds of silence.
|
| - const int64 cont_timeout_us = base::Time::kMicrosecondsPerSecond * 15;
|
| + const int64_t cont_timeout_us = base::Time::kMicrosecondsPerSecond * 15;
|
| endpointer_.set_speech_input_complete_silence_length(cont_timeout_us);
|
| endpointer_.set_long_speech_length(0); // Use only a single timeout.
|
| }
|
|
|