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

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

Issue 10233010: Introducing new data types and IPC messages for scripted JS speech recognition APIs (Speech CL2.0) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed according to Hans review. Created 8 years, 8 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
Index: content/browser/speech/speech_recognition_engine.h
diff --git a/content/browser/speech/speech_recognition_engine.h b/content/browser/speech/speech_recognition_engine.h
index 5b64d67865697657f13f96bcdfb6ba093bb93618..78702acadaeb7907f6bfdd9ee1ff7061c05c3a1f 100644
--- a/content/browser/speech/speech_recognition_engine.h
+++ b/content/browser/speech/speech_recognition_engine.h
@@ -7,9 +7,9 @@
#pragma once
#include <string>
-#include <vector>
#include "base/basictypes.h"
+#include "content/public/common/speech_recognition_grammar.h"
namespace content {
struct SpeechRecognitionResult;
@@ -20,6 +20,19 @@ namespace speech {
class AudioChunk;
+struct SpeechRecognitionEngineConfig {
Satish 2012/04/27 10:04:41 move this as an inner class of SpeechRecognitionEn
Primiano Tucci (use gerrit) 2012/04/27 15:58:44 Done.
+ SpeechRecognitionEngineConfig();
+ ~SpeechRecognitionEngineConfig();
+
+ std::string language;
+ content::SpeechRecognitionGrammarArray grammars;
+ bool filter_profanities;
+ std::string hardware_info;
+ std::string origin_url;
+ int audio_sample_rate;
+ int audio_num_bits_per_sample;
+};
+
// This interface models the basic contract that a speech recognition engine,
// either working locally or relying on a remote web-service, must obey.
// The expected call sequence for exported methods is:
@@ -27,7 +40,9 @@ class AudioChunk;
// TakeAudioChunk For every audio chunk pushed.
// AudioChunksEnded Finalize the audio stream (omitted in case of errors).
// EndRecognition Mandatory at end of SR (even on errors).
-// No delegate callback is allowed before Initialize() or after Cleanup().
+// No delegate callbacks are allowed before StartRecognition or after
+// EndRecognition. If a recognition was started, the caller can free the
+// SpeechRecognitionEnding only after calling EndRecognition.
Satish 2012/04/27 10:04:41 Ending -> Engine
Primiano Tucci (use gerrit) 2012/04/27 15:58:44 Done.
class SpeechRecognitionEngine {
public:
// Interface for receiving callbacks from this object.
@@ -47,6 +62,10 @@ class SpeechRecognitionEngine {
virtual ~SpeechRecognitionEngine() {}
+ // Set/change the recognition engine configuration. It is not allowed to call
+ // this function while a recognition is ongoing.
+ virtual void SetConfig(const SpeechRecognitionEngineConfig& config) = 0;
+
// Called when the speech recognition begins, before any TakeAudioChunk call.
virtual void StartRecognition() = 0;

Powered by Google App Engine
This is Rietveld 408576698