summaryrefslogtreecommitdiffstats
path: root/content/public/browser/speech_recognition_session_preamble.h
blob: 589953184d5ce1fd1d473cb63c3d8c26e727d5f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_SESSION_PREAMBLE_H_
#define CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_SESSION_PREAMBLE_H_

#include <vector>

#include "base/memory/ref_counted.h"
#include "content/common/content_export.h"

namespace content {

// The preamble is the few seconds of audio before the speech recognition
// starts. This is used to contain trigger audio used to start a voice
// query, such as the 'Ok Google' hotword.
struct CONTENT_EXPORT SpeechRecognitionSessionPreamble
    : public base::RefCounted<SpeechRecognitionSessionPreamble> {
  SpeechRecognitionSessionPreamble();

  // Sampling rate (hz) for the preamble data. i.e. 44100, 32000, etc
  int sample_rate;

  // Bytes per sample.
  int sample_depth;

  // Audio data, in little-endian samples.
  std::vector<char> sample_data;

 private:
  friend class base::RefCounted<SpeechRecognitionSessionPreamble>;
  ~SpeechRecognitionSessionPreamble();
};

}  // namespace content

#endif  // CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_SESSION_PREAMBLE_H_