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

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

Issue 549373003: Binding media stream audio track to speech recognition [browser] Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Introduce SpeechRecognitionAudioReceiver Created 6 years, 2 months 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
« no previous file with comments | « content/browser/speech/speech_recognizer.h ('k') | content/browser/speech/speech_recognizer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/speech/speech_recognizer_impl.h
diff --git a/content/browser/speech/speech_recognizer_impl.h b/content/browser/speech/speech_recognizer_impl.h
index bd869ee570799fb86ad45c16b463c96e7106e4c9..31af59dbeab6ad924f5d3dd1c9f67ba07368ba2a 100644
--- a/content/browser/speech/speech_recognizer_impl.h
+++ b/content/browser/speech/speech_recognizer_impl.h
@@ -7,6 +7,7 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
+#include "base/process/process_handle.h"
#include "content/browser/speech/endpointer/endpointer.h"
#include "content/browser/speech/speech_recognition_engine.h"
#include "content/browser/speech/speech_recognizer.h"
@@ -19,10 +20,12 @@
namespace media {
class AudioBus;
class AudioManager;
+class AudioParameters;
}
namespace content {
+class SpeechRecognitionAudioReceiver;
class SpeechRecognitionEventListener;
// Handles speech recognition for a session (identified by |session_id|), taking
@@ -40,11 +43,11 @@ class CONTENT_EXPORT SpeechRecognizerImpl
static const int kEndpointerEstimationTimeMs;
static void SetAudioManagerForTesting(media::AudioManager* audio_manager);
-
- SpeechRecognizerImpl(SpeechRecognitionEventListener* listener,
- int session_id,
- bool continuous,
- bool provisional_results,
+ // TODO(burnik): abstract out the process_handle. Pass differently.
+ SpeechRecognizerImpl(SpeechRecognitionEventListener* listener, int session_id,
burnik 2014/10/15 14:52:27 Will move each param on it's own line.
+ bool continuous, bool provisional_results,
+ bool using_audio_receiver,
+ base::ProcessHandle process_handle,
SpeechRecognitionEngine* engine);
virtual void StartRecognition(const std::string& device_id) OVERRIDE;
@@ -116,6 +119,9 @@ class CONTENT_EXPORT SpeechRecognizerImpl
FSMState DoNothing(const FSMEventArgs& event_args) const;
FSMState NotFeasible(const FSMEventArgs& event_args);
+ // Called from |StartRecording()| when using |audio_receiver_|.
+ bool StartRecordingUsingAudioReceiver(const media::AudioParameters& params);
+
// Returns the time span of captured audio samples since the start of capture.
int GetElapsedTimeMs() const;
@@ -154,6 +160,8 @@ class CONTENT_EXPORT SpeechRecognizerImpl
float audio_level_;
bool is_dispatching_event_;
bool provisional_results_;
+ bool using_audio_receiver_;
+ base::ProcessHandle peer_process_handle_;
FSMState state_;
std::string device_id_;
@@ -163,6 +171,9 @@ class CONTENT_EXPORT SpeechRecognizerImpl
// output format.
scoped_ptr<SpeechRecognizerImpl::OnDataConverter> audio_converter_;
+ // Used when getting audio data from the renderer.
+ scoped_ptr<SpeechRecognitionAudioReceiver> audio_receiver_;
+
DISALLOW_COPY_AND_ASSIGN(SpeechRecognizerImpl);
};
« no previous file with comments | « content/browser/speech/speech_recognizer.h ('k') | content/browser/speech/speech_recognizer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698