| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_SESSION_PREAMBLE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_SESSION_PREAMBLE_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_SESSION_PREAMBLE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_SESSION_PREAMBLE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 | 14 |
| 15 // The preamble is the few seconds of audio before the speech recognition | 15 // The preamble is the few seconds of audio before the speech recognition |
| 16 // starts. This is used to contain trigger audio used to start a voice | 16 // starts. This is used to contain trigger audio used to start a voice |
| 17 // query, such as the 'Ok Google' hotword. | 17 // query, such as the 'Ok Google' hotword. |
| 18 struct CONTENT_EXPORT SpeechRecognitionSessionPreamble | 18 struct CONTENT_EXPORT SpeechRecognitionSessionPreamble |
| 19 : public base::RefCounted<SpeechRecognitionSessionPreamble> { | 19 : public base::RefCounted<SpeechRecognitionSessionPreamble> { |
| 20 SpeechRecognitionSessionPreamble(); | 20 SpeechRecognitionSessionPreamble(); |
| 21 | 21 |
| 22 // Sampling rate (hz) for the preamble data. i.e. 44100, 32000, etc | 22 // Sampling rate (hz) for the preamble data. i.e. 44100, 32000, etc |
| 23 int sample_rate; | 23 int sample_rate; |
| 24 | 24 |
| 25 // Bytes per sample. | 25 // Bytes per sample. |
| 26 int sample_depth; | 26 int sample_depth; |
| 27 | 27 |
| 28 // Audio data, in little-endian samples. | 28 // Audio data, in little-endian samples. |
| 29 std::string sample_data; | 29 std::vector<char> sample_data; |
| 30 | 30 |
| 31 private: | 31 private: |
| 32 friend class base::RefCounted<SpeechRecognitionSessionPreamble>; | 32 friend class base::RefCounted<SpeechRecognitionSessionPreamble>; |
| 33 ~SpeechRecognitionSessionPreamble(); | 33 ~SpeechRecognitionSessionPreamble(); |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 } // namespace content | 36 } // namespace content |
| 37 | 37 |
| 38 #endif // CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_SESSION_PREAMBLE_H_ | 38 #endif // CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_SESSION_PREAMBLE_H_ |
| OLD | NEW |