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; |