OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/browser/speech/speech_recognizer_impl.h" | 5 #include "content/browser/speech/speech_recognizer_impl.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "content/browser/browser_main_loop.h" | 10 #include "content/browser/browser_main_loop.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 virtual ~OnDataConverter(); | 39 virtual ~OnDataConverter(); |
40 | 40 |
41 // Converts input audio |data| bus into an AudioChunk where the input format | 41 // Converts input audio |data| bus into an AudioChunk where the input format |
42 // is given by |input_parameters_| and the output format by | 42 // is given by |input_parameters_| and the output format by |
43 // |output_parameters_|. | 43 // |output_parameters_|. |
44 scoped_refptr<AudioChunk> Convert(const AudioBus* data); | 44 scoped_refptr<AudioChunk> Convert(const AudioBus* data); |
45 | 45 |
46 private: | 46 private: |
47 // media::AudioConverter::InputCallback implementation. | 47 // media::AudioConverter::InputCallback implementation. |
48 virtual double ProvideInput(AudioBus* dest, | 48 virtual double ProvideInput(AudioBus* dest, |
49 base::TimeDelta buffer_delay) OVERRIDE; | 49 base::TimeDelta buffer_delay) override; |
50 | 50 |
51 // Handles resampling, buffering, and channel mixing between input and output | 51 // Handles resampling, buffering, and channel mixing between input and output |
52 // parameters. | 52 // parameters. |
53 AudioConverter audio_converter_; | 53 AudioConverter audio_converter_; |
54 | 54 |
55 scoped_ptr<AudioBus> input_bus_; | 55 scoped_ptr<AudioBus> input_bus_; |
56 scoped_ptr<AudioBus> output_bus_; | 56 scoped_ptr<AudioBus> output_bus_; |
57 const AudioParameters input_parameters_; | 57 const AudioParameters input_parameters_; |
58 const AudioParameters output_parameters_; | 58 const AudioParameters output_parameters_; |
59 bool waiting_for_input_; | 59 bool waiting_for_input_; |
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
815 SpeechRecognizerImpl::FSMEventArgs::FSMEventArgs(FSMEvent event_value) | 815 SpeechRecognizerImpl::FSMEventArgs::FSMEventArgs(FSMEvent event_value) |
816 : event(event_value), | 816 : event(event_value), |
817 audio_data(NULL), | 817 audio_data(NULL), |
818 engine_error(SPEECH_RECOGNITION_ERROR_NONE) { | 818 engine_error(SPEECH_RECOGNITION_ERROR_NONE) { |
819 } | 819 } |
820 | 820 |
821 SpeechRecognizerImpl::FSMEventArgs::~FSMEventArgs() { | 821 SpeechRecognizerImpl::FSMEventArgs::~FSMEventArgs() { |
822 } | 822 } |
823 | 823 |
824 } // namespace content | 824 } // namespace content |
OLD | NEW |