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

Side by Side Diff: content/public/browser/speech_recognizer.h

Issue 10440011: SpeechInputExtensionManager now interface (exclusively) with SpeechRecognitionManagerDelegate (Spee… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Satish review Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/public/browser/speech_recognition_session_context.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNIZER_H_
6 #define CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNIZER_H_
7 #pragma once
8
9 #include <string>
10
11 #include "base/memory/ref_counted.h"
12 #include "content/common/content_export.h"
13
14 namespace net {
15 class URLRequestContextGetter;
16 }
17
18 namespace content {
19
20 class SpeechRecognitionEventListener;
21
22 // Records audio, sends recorded audio to server and translates server response
23 // to recognition result.
24 // TODO(primiano) remove this public interface as soon as we fix speech input
25 // extensions.
26 class SpeechRecognizer : public base::RefCountedThreadSafe<SpeechRecognizer> {
27 public:
28 CONTENT_EXPORT static SpeechRecognizer* Create(
29 SpeechRecognitionEventListener* event_listener,
30 int session_id,
31 const std::string& language,
32 const std::string& grammar,
33 net::URLRequestContextGetter* context_getter,
34 bool filter_profanities,
35 const std::string& hardware_info,
36 const std::string& origin_url);
37
38 // Starts audio recording and the recognition process. The same
39 // SpeechRecognizer instance can be used multiple times for speech recognition
40 // though each recognition request can be made only after the previous one
41 // completes (i.e. after receiving
42 // SpeechRecognitionEventListener::OnRecognitionEnd).
43 virtual void StartRecognition() = 0;
44
45 // Stops recording audio and cancels recognition. Any audio recorded so far
46 // gets discarded.
47 virtual void AbortRecognition() = 0;
48
49 // Stops recording audio and finalizes recognition, possibly getting results.
50 virtual void StopAudioCapture() = 0;
51
52 // Checks wether the recognizer is active, that is, either capturing audio
53 // or waiting for a result.
54 virtual bool IsActive() const = 0;
55
56 // Checks whether the recognizer is capturing audio.
57 virtual bool IsCapturingAudio() const = 0;
58
59 protected:
60 friend class base::RefCountedThreadSafe<SpeechRecognizer>;
61 virtual ~SpeechRecognizer() {}
62 };
63
64 } // namespace content
65
66 #endif // CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNIZER_H_
OLDNEW
« no previous file with comments | « content/public/browser/speech_recognition_session_context.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698