Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(442)

Unified Diff: content/browser/speech/speech_recognizer_impl.cc

Issue 1549113002: Switch to standard integer types in content/browser/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.
}
« no previous file with comments | « content/browser/speech/speech_recognizer_impl.h ('k') | content/browser/speech/speech_recognizer_impl_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698