OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/media/speech_recognition_audio_sink.h" | 5 #include "content/renderer/media/speech_recognition_audio_sink.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <string.h> | 9 #include <string.h> |
10 #include <utility> | 10 #include <utility> |
11 | 11 |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
15 #include "content/renderer/media/media_stream_audio_source.h" | 15 #include "content/renderer/media/media_stream_audio_source.h" |
16 #include "content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h" | 16 #include "content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h" |
17 #include "content/renderer/media/webrtc_local_audio_track.h" | 17 #include "content/renderer/media/webrtc_local_audio_track.h" |
18 #include "media/audio/audio_parameters.h" | |
19 #include "media/base/audio_bus.h" | 18 #include "media/base/audio_bus.h" |
| 19 #include "media/base/audio_parameters.h" |
20 #include "testing/gmock/include/gmock/gmock.h" | 20 #include "testing/gmock/include/gmock/gmock.h" |
21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
22 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" | 22 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" |
23 #include "third_party/WebKit/public/web/WebHeap.h" | 23 #include "third_party/WebKit/public/web/WebHeap.h" |
24 | 24 |
25 namespace { | 25 namespace { |
26 | 26 |
27 // Supported speech recognition audio parameters. | 27 // Supported speech recognition audio parameters. |
28 const int kSpeechRecognitionSampleRate = 16000; | 28 const int kSpeechRecognitionSampleRate = 16000; |
29 const int kSpeechRecognitionFramesPerBuffer = 1600; | 29 const int kSpeechRecognitionFramesPerBuffer = 1600; |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 const uint32_t buffers_per_notification = Initialize(44100, 441, 16000, 1600); | 521 const uint32_t buffers_per_notification = Initialize(44100, 441, 16000, 1600); |
522 AssertConsumedBuffers(0U); | 522 AssertConsumedBuffers(0U); |
523 CaptureAudioAndAssertConsumedBuffers(buffers_per_notification, 1U); | 523 CaptureAudioAndAssertConsumedBuffers(buffers_per_notification, 1U); |
524 EXPECT_CALL(*this, StoppedCallback()).Times(1); | 524 EXPECT_CALL(*this, StoppedCallback()).Times(1); |
525 | 525 |
526 native_track()->Stop(); | 526 native_track()->Stop(); |
527 CaptureAudioAndAssertConsumedBuffers(buffers_per_notification, 1U); | 527 CaptureAudioAndAssertConsumedBuffers(buffers_per_notification, 1U); |
528 } | 528 } |
529 | 529 |
530 } // namespace content | 530 } // namespace content |
OLD | NEW |