File: tts_extension_api_constants.h

package info (click to toggle)
chromium 140.0.7339.127-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,192,880 kB
  • sloc: cpp: 35,093,808; ansic: 7,161,670; javascript: 4,199,694; python: 1,441,797; asm: 949,904; xml: 747,503; pascal: 187,748; perl: 88,691; sh: 88,248; objc: 79,953; sql: 52,714; cs: 44,599; fortran: 24,137; makefile: 22,114; tcl: 15,277; php: 13,980; yacc: 9,000; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (76 lines) | stat: -rw-r--r-- 3,648 bytes parent folder | download | duplicates (3)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_SPEECH_EXTENSION_API_TTS_EXTENSION_API_CONSTANTS_H_
#define CHROME_BROWSER_SPEECH_EXTENSION_API_TTS_EXTENSION_API_CONSTANTS_H_

#include "extensions/buildflags/buildflags.h"

static_assert(BUILDFLAG(ENABLE_EXTENSIONS_CORE));

namespace tts_extension_api_constants {

inline constexpr char kCharIndexKey[] = "charIndex";
inline constexpr char kLengthKey[] = "length";
inline constexpr char kDesiredEventTypesKey[] = "desiredEventTypes";
inline constexpr char kEnqueueKey[] = "enqueue";
inline constexpr char kErrorKey[] = "error";
inline constexpr char kErrorMessageKey[] = "errorMessage";
inline constexpr char kEventTypeKey[] = "type";
inline constexpr char kEventTypesKey[] = "eventTypes";
inline constexpr char kExtensionIdKey[] = "extensionId";
inline constexpr char kGenderKey[] = "gender";
inline constexpr char kIdKey[] = "id";
inline constexpr char kInstallStatusKey[] = "installStatus";
inline constexpr char kIsFinalEventKey[] = "isFinalEvent";
inline constexpr char kLangKey[] = "lang";
inline constexpr char kOnEventKey[] = "onEvent";
inline constexpr char kPitchKey[] = "pitch";
inline constexpr char kRateKey[] = "rate";
inline constexpr char kRemoteKey[] = "remote";
inline constexpr char kUninstallImmediatelyKey[] = "uninstallImmediately";
inline constexpr char kRequiredEventTypesKey[] = "requiredEventTypes";
inline constexpr char kSourceKey[] = "source";
inline constexpr char kSrcIdKey[] = "srcId";
inline constexpr char kVoiceNameKey[] = "voiceName";
inline constexpr char kVolumeKey[] = "volume";

inline constexpr char kSampleRateKey[] = "sampleRate";
inline constexpr char kBufferSizeKey[] = "bufferSize";
inline constexpr char kAudioBufferKey[] = "audioBuffer";
inline constexpr char kIsLastBufferKey[] = "isLastBuffer";

inline constexpr char kEventTypeCancelled[] = "cancelled";
inline constexpr char kEventTypeEnd[] = "end";
inline constexpr char kEventTypeError[] = "error";
inline constexpr char kEventTypeInterrupted[] = "interrupted";
inline constexpr char kEventTypeMarker[] = "marker";
inline constexpr char kEventTypePause[] = "pause";
inline constexpr char kEventTypeResume[] = "resume";
inline constexpr char kEventTypeSentence[] = "sentence";
inline constexpr char kEventTypeStart[] = "start";
inline constexpr char kEventTypeWord[] = "word";

// Used by TtsEngine Extension to communicate installation status of voices for
// a specific language
inline constexpr char kVoicePackStatusNotInstalled[] = "notInstalled";
inline constexpr char kVoicePackStatusInstalling[] = "installing";
inline constexpr char kVoicePackStatusInstalled[] = "installed";
inline constexpr char kVoicePackStatusFailed[] = "failed";

inline constexpr char kErrorExtensionIdMismatch[] = "Extension id mismatch.";
inline constexpr char kErrorInvalidLang[] = "Invalid lang.";
inline constexpr char kErrorInvalidPitch[] = "Invalid pitch.";
inline constexpr char kErrorInvalidRate[] = "Invalid rate.";
inline constexpr char kErrorInvalidVolume[] = "Invalid volume.";
inline constexpr char kErrorMissingPauseOrResume[] =
    "A TTS engine extension should either listen for both onPause and onResume "
    "events, or neither.";
inline constexpr char kErrorUndeclaredEventType[] =
    "Cannot send an event type that is not declared in the extension manifest.";
inline constexpr char kErrorUtteranceTooLong[] =
    "Utterance length is too long.";

}  // namespace tts_extension_api_constants.
#endif  // CHROME_BROWSER_SPEECH_EXTENSION_API_TTS_EXTENSION_API_CONSTANTS_H_