diff --git a/cobalt/speech/BUILD.gn b/cobalt/speech/BUILD.gn index 1e20f72a3c81..6fae2d802438 100644 --- a/cobalt/speech/BUILD.gn +++ b/cobalt/speech/BUILD.gn @@ -12,22 +12,21 @@ # See the License for the specific language governing permissions and # limitations under the License. +import("//third_party/protobuf/proto_library.gni") + config("enable_fake_microphone_public") { defines = [ "ENABLE_FAKE_MICROPHONE" ] } config("speech_config") { - if (is_win) { - cflags = [ - # Dereferencing NULL pointer in generated file - # google_streaming_api.pb.cc. - "/wd6011", - ] - } - include_dirs = [ "//third_party/protobuf/src" ] } +proto_library("google_streaming_api_proto") { + sources = [ "google_streaming_api.proto" ] + generate_python = false +} + copy("speech_testdata") { install_content = true @@ -56,8 +55,6 @@ static_library("speech") { "endpointer_delegate.h", "google_speech_service.cc", "google_speech_service.h", - "google_streaming_api.pb.cc", - "google_streaming_api.pb.h", "microphone.h", "microphone_manager.cc", "microphone_manager.h", @@ -98,6 +95,7 @@ static_library("speech") { ] deps = [ + ":google_streaming_api_proto", "//cobalt/base", "//cobalt/loader", "//cobalt/media", diff --git a/cobalt/speech/google_streaming_api.pb.cc b/cobalt/speech/google_streaming_api.pb.cc deleted file mode 100644 index fc0f00312797..000000000000 --- a/cobalt/speech/google_streaming_api.pb.cc +++ /dev/null @@ -1,1249 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google_streaming_api.proto - -#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION -#include "google_streaming_api.pb.h" - -#include - -#include -#include -#include -#include -#include -#include -#include -// @@protoc_insertion_point(includes) - -namespace cobalt { -namespace speech { -namespace proto { - -void protobuf_ShutdownFile_google_5fstreaming_5fapi_2eproto() { - delete SpeechRecognitionEvent::default_instance_; - delete SpeechRecognitionResult::default_instance_; - delete SpeechRecognitionAlternative::default_instance_; -} - -#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -void protobuf_AddDesc_google_5fstreaming_5fapi_2eproto_impl() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - -#else -void protobuf_AddDesc_google_5fstreaming_5fapi_2eproto() { - static bool already_here = false; - if (already_here) return; - already_here = true; - GOOGLE_PROTOBUF_VERIFY_VERSION; - -#endif - SpeechRecognitionEvent::default_instance_ = new SpeechRecognitionEvent(); - SpeechRecognitionResult::default_instance_ = new SpeechRecognitionResult(); - SpeechRecognitionAlternative::default_instance_ = new SpeechRecognitionAlternative(); - SpeechRecognitionEvent::default_instance_->InitAsDefaultInstance(); - SpeechRecognitionResult::default_instance_->InitAsDefaultInstance(); - SpeechRecognitionAlternative::default_instance_->InitAsDefaultInstance(); - ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_5fstreaming_5fapi_2eproto); -} - -#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_google_5fstreaming_5fapi_2eproto_once_); -void protobuf_AddDesc_google_5fstreaming_5fapi_2eproto() { - ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_google_5fstreaming_5fapi_2eproto_once_, - &protobuf_AddDesc_google_5fstreaming_5fapi_2eproto_impl); -} -#else -// Force AddDescriptors() to be called at static initialization time. -struct StaticDescriptorInitializer_google_5fstreaming_5fapi_2eproto { - StaticDescriptorInitializer_google_5fstreaming_5fapi_2eproto() { - protobuf_AddDesc_google_5fstreaming_5fapi_2eproto(); - } -} static_descriptor_initializer_google_5fstreaming_5fapi_2eproto_; -#endif - -namespace { - -static void MergeFromFail(int line) GOOGLE_ATTRIBUTE_COLD; -GOOGLE_ATTRIBUTE_NOINLINE static void MergeFromFail(int line) { - GOOGLE_CHECK(false) << __FILE__ << ":" << line; -} - -} // namespace - - -// =================================================================== - -static ::std::string* MutableUnknownFieldsForSpeechRecognitionEvent( - SpeechRecognitionEvent* ptr) { - return ptr->mutable_unknown_fields(); -} - -bool SpeechRecognitionEvent_StatusCode_IsValid(int value) { - switch(value) { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - return true; - default: - return false; - } -} - -#if !defined(_MSC_VER) || _MSC_VER >= 1900 -const SpeechRecognitionEvent_StatusCode SpeechRecognitionEvent::STATUS_SUCCESS; -const SpeechRecognitionEvent_StatusCode SpeechRecognitionEvent::STATUS_NO_SPEECH; -const SpeechRecognitionEvent_StatusCode SpeechRecognitionEvent::STATUS_ABORTED; -const SpeechRecognitionEvent_StatusCode SpeechRecognitionEvent::STATUS_AUDIO_CAPTURE; -const SpeechRecognitionEvent_StatusCode SpeechRecognitionEvent::STATUS_NETWORK; -const SpeechRecognitionEvent_StatusCode SpeechRecognitionEvent::STATUS_NOT_ALLOWED; -const SpeechRecognitionEvent_StatusCode SpeechRecognitionEvent::STATUS_SERVICE_NOT_ALLOWED; -const SpeechRecognitionEvent_StatusCode SpeechRecognitionEvent::STATUS_BAD_GRAMMAR; -const SpeechRecognitionEvent_StatusCode SpeechRecognitionEvent::STATUS_LANGUAGE_NOT_SUPPORTED; -const SpeechRecognitionEvent_StatusCode SpeechRecognitionEvent::StatusCode_MIN; -const SpeechRecognitionEvent_StatusCode SpeechRecognitionEvent::StatusCode_MAX; -const int SpeechRecognitionEvent::StatusCode_ARRAYSIZE; -#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 -bool SpeechRecognitionEvent_EndpointerEventType_IsValid(int value) { - switch(value) { - case 0: - case 1: - case 2: - case 3: - return true; - default: - return false; - } -} - -#if !defined(_MSC_VER) || _MSC_VER >= 1900 -const SpeechRecognitionEvent_EndpointerEventType SpeechRecognitionEvent::START_OF_SPEECH; -const SpeechRecognitionEvent_EndpointerEventType SpeechRecognitionEvent::END_OF_SPEECH; -const SpeechRecognitionEvent_EndpointerEventType SpeechRecognitionEvent::END_OF_AUDIO; -const SpeechRecognitionEvent_EndpointerEventType SpeechRecognitionEvent::END_OF_UTTERANCE; -const SpeechRecognitionEvent_EndpointerEventType SpeechRecognitionEvent::EndpointerEventType_MIN; -const SpeechRecognitionEvent_EndpointerEventType SpeechRecognitionEvent::EndpointerEventType_MAX; -const int SpeechRecognitionEvent::EndpointerEventType_ARRAYSIZE; -#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 -#if !defined(_MSC_VER) || _MSC_VER >= 1900 -const int SpeechRecognitionEvent::kStatusFieldNumber; -const int SpeechRecognitionEvent::kResultFieldNumber; -const int SpeechRecognitionEvent::kEndpointFieldNumber; -#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 - -SpeechRecognitionEvent::SpeechRecognitionEvent() - : ::google::protobuf::MessageLite(), _arena_ptr_(NULL) { - SharedCtor(); - // @@protoc_insertion_point(constructor:cobalt.speech.proto.SpeechRecognitionEvent) -} - -void SpeechRecognitionEvent::InitAsDefaultInstance() { -} - -SpeechRecognitionEvent::SpeechRecognitionEvent(const SpeechRecognitionEvent& from) - : ::google::protobuf::MessageLite(), - _arena_ptr_(NULL) { - SharedCtor(); - MergeFrom(from); - // @@protoc_insertion_point(copy_constructor:cobalt.speech.proto.SpeechRecognitionEvent) -} - -void SpeechRecognitionEvent::SharedCtor() { - ::google::protobuf::internal::GetEmptyString(); - _cached_size_ = 0; - _unknown_fields_.UnsafeSetDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - status_ = 0; - endpoint_ = 0; - ::memset(_has_bits_, 0, sizeof(_has_bits_)); -} - -SpeechRecognitionEvent::~SpeechRecognitionEvent() { - // @@protoc_insertion_point(destructor:cobalt.speech.proto.SpeechRecognitionEvent) - SharedDtor(); -} - -void SpeechRecognitionEvent::SharedDtor() { - _unknown_fields_.DestroyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - if (this != &default_instance()) { - #else - if (this != default_instance_) { - #endif - } -} - -void SpeechRecognitionEvent::SetCachedSize(int size) const { - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); -} -const SpeechRecognitionEvent& SpeechRecognitionEvent::default_instance() { -#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - protobuf_AddDesc_google_5fstreaming_5fapi_2eproto(); -#else - if (default_instance_ == NULL) protobuf_AddDesc_google_5fstreaming_5fapi_2eproto(); -#endif - return *default_instance_; -} - -SpeechRecognitionEvent* SpeechRecognitionEvent::default_instance_ = NULL; - -SpeechRecognitionEvent* SpeechRecognitionEvent::New(::google::protobuf::Arena* arena) const { - SpeechRecognitionEvent* n = new SpeechRecognitionEvent; - if (arena != NULL) { - arena->Own(n); - } - return n; -} - -void SpeechRecognitionEvent::Clear() { -// @@protoc_insertion_point(message_clear_start:cobalt.speech.proto.SpeechRecognitionEvent) -#if defined(__clang__) -#define ZR_HELPER_(f) \ - _Pragma("clang diagnostic push") \ - _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ - __builtin_offsetof(SpeechRecognitionEvent, f) \ - _Pragma("clang diagnostic pop") -#else -#define ZR_HELPER_(f) reinterpret_cast(\ - &reinterpret_cast(16)->f) -#endif - -#define ZR_(first, last) do {\ - ::memset(&first, 0,\ - ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ -} while (0) - - ZR_(status_, endpoint_); - -#undef ZR_HELPER_ -#undef ZR_ - - result_.Clear(); - ::memset(_has_bits_, 0, sizeof(_has_bits_)); - _unknown_fields_.ClearToEmptyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} - -bool SpeechRecognitionEvent::MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure - ::google::protobuf::uint32 tag; - ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( - ::google::protobuf::internal::NewPermanentCallback( - &MutableUnknownFieldsForSpeechRecognitionEvent, this)); - ::google::protobuf::io::CodedOutputStream unknown_fields_stream( - &unknown_fields_string, false); - // @@protoc_insertion_point(parse_start:cobalt.speech.proto.SpeechRecognitionEvent) - for (;;) { - ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // optional .cobalt.speech.proto.SpeechRecognitionEvent.StatusCode status = 1 [default = STATUS_SUCCESS]; - case 1: { - if (tag == 8) { - int value; - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( - input, &value))); - if (::cobalt::speech::proto::SpeechRecognitionEvent_StatusCode_IsValid(value)) { - set_status(static_cast< ::cobalt::speech::proto::SpeechRecognitionEvent_StatusCode >(value)); - } else { - unknown_fields_stream.WriteVarint32(8); - unknown_fields_stream.WriteVarint32(value); - } - } else { - goto handle_unusual; - } - if (input->ExpectTag(18)) goto parse_result; - break; - } - - // repeated .cobalt.speech.proto.SpeechRecognitionResult result = 2; - case 2: { - if (tag == 18) { - parse_result: - DO_(input->IncrementRecursionDepth()); - parse_loop_result: - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( - input, add_result())); - } else { - goto handle_unusual; - } - if (input->ExpectTag(18)) goto parse_loop_result; - input->UnsafeDecrementRecursionDepth(); - if (input->ExpectTag(32)) goto parse_endpoint; - break; - } - - // optional .cobalt.speech.proto.SpeechRecognitionEvent.EndpointerEventType endpoint = 4; - case 4: { - if (tag == 32) { - parse_endpoint: - int value; - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( - input, &value))); - if (::cobalt::speech::proto::SpeechRecognitionEvent_EndpointerEventType_IsValid(value)) { - set_endpoint(static_cast< ::cobalt::speech::proto::SpeechRecognitionEvent_EndpointerEventType >(value)); - } else { - unknown_fields_stream.WriteVarint32(32); - unknown_fields_stream.WriteVarint32(value); - } - } else { - goto handle_unusual; - } - if (input->ExpectAtEnd()) goto success; - break; - } - - default: { - handle_unusual: - if (tag == 0 || - ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - goto success; - } - DO_(::google::protobuf::internal::WireFormatLite::SkipField( - input, tag, &unknown_fields_stream)); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:cobalt.speech.proto.SpeechRecognitionEvent) - return true; -failure: - // @@protoc_insertion_point(parse_failure:cobalt.speech.proto.SpeechRecognitionEvent) - return false; -#undef DO_ -} - -void SpeechRecognitionEvent::SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:cobalt.speech.proto.SpeechRecognitionEvent) - // optional .cobalt.speech.proto.SpeechRecognitionEvent.StatusCode status = 1 [default = STATUS_SUCCESS]; - if (has_status()) { - ::google::protobuf::internal::WireFormatLite::WriteEnum( - 1, this->status(), output); - } - - // repeated .cobalt.speech.proto.SpeechRecognitionResult result = 2; - for (unsigned int i = 0, n = this->result_size(); i < n; i++) { - ::google::protobuf::internal::WireFormatLite::WriteMessage( - 2, this->result(i), output); - } - - // optional .cobalt.speech.proto.SpeechRecognitionEvent.EndpointerEventType endpoint = 4; - if (has_endpoint()) { - ::google::protobuf::internal::WireFormatLite::WriteEnum( - 4, this->endpoint(), output); - } - - output->WriteRaw(unknown_fields().data(), - static_cast(unknown_fields().size())); - // @@protoc_insertion_point(serialize_end:cobalt.speech.proto.SpeechRecognitionEvent) -} - -int SpeechRecognitionEvent::ByteSize() const { -// @@protoc_insertion_point(message_byte_size_start:cobalt.speech.proto.SpeechRecognitionEvent) - int total_size = 0; - - if (_has_bits_[0 / 32] & 5u) { - // optional .cobalt.speech.proto.SpeechRecognitionEvent.StatusCode status = 1 [default = STATUS_SUCCESS]; - if (has_status()) { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::EnumSize(this->status()); - } - - // optional .cobalt.speech.proto.SpeechRecognitionEvent.EndpointerEventType endpoint = 4; - if (has_endpoint()) { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::EnumSize(this->endpoint()); - } - - } - // repeated .cobalt.speech.proto.SpeechRecognitionResult result = 2; - total_size += 1 * this->result_size(); - for (int i = 0; i < this->result_size(); i++) { - total_size += - ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( - this->result(i)); - } - - total_size += unknown_fields().size(); - - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = total_size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); - return total_size; -} - -void SpeechRecognitionEvent::CheckTypeAndMergeFrom( - const ::google::protobuf::MessageLite& from) { - MergeFrom(*::google::protobuf::down_cast(&from)); -} - -void SpeechRecognitionEvent::MergeFrom(const SpeechRecognitionEvent& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:cobalt.speech.proto.SpeechRecognitionEvent) - if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); - result_.MergeFrom(from.result_); - if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { - if (from.has_status()) { - set_status(from.status()); - } - if (from.has_endpoint()) { - set_endpoint(from.endpoint()); - } - } - if (!from.unknown_fields().empty()) { - mutable_unknown_fields()->append(from.unknown_fields()); - } -} - -void SpeechRecognitionEvent::CopyFrom(const SpeechRecognitionEvent& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:cobalt.speech.proto.SpeechRecognitionEvent) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool SpeechRecognitionEvent::IsInitialized() const { - - return true; -} - -void SpeechRecognitionEvent::Swap(SpeechRecognitionEvent* other) { - if (other == this) return; - InternalSwap(other); -} -void SpeechRecognitionEvent::InternalSwap(SpeechRecognitionEvent* other) { - std::swap(status_, other->status_); - result_.UnsafeArenaSwap(&other->result_); - std::swap(endpoint_, other->endpoint_); - std::swap(_has_bits_[0], other->_has_bits_[0]); - _unknown_fields_.Swap(&other->_unknown_fields_); - std::swap(_cached_size_, other->_cached_size_); -} - -::std::string SpeechRecognitionEvent::GetTypeName() const { - return "cobalt.speech.proto.SpeechRecognitionEvent"; -} - -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// SpeechRecognitionEvent - -// optional .cobalt.speech.proto.SpeechRecognitionEvent.StatusCode status = 1 [default = STATUS_SUCCESS]; -bool SpeechRecognitionEvent::has_status() const { - return (_has_bits_[0] & 0x00000001u) != 0; -} -void SpeechRecognitionEvent::set_has_status() { - _has_bits_[0] |= 0x00000001u; -} -void SpeechRecognitionEvent::clear_has_status() { - _has_bits_[0] &= ~0x00000001u; -} -void SpeechRecognitionEvent::clear_status() { - status_ = 0; - clear_has_status(); -} - ::cobalt::speech::proto::SpeechRecognitionEvent_StatusCode SpeechRecognitionEvent::status() const { - // @@protoc_insertion_point(field_get:cobalt.speech.proto.SpeechRecognitionEvent.status) - return static_cast< ::cobalt::speech::proto::SpeechRecognitionEvent_StatusCode >(status_); -} - void SpeechRecognitionEvent::set_status(::cobalt::speech::proto::SpeechRecognitionEvent_StatusCode value) { - assert(::cobalt::speech::proto::SpeechRecognitionEvent_StatusCode_IsValid(value)); - set_has_status(); - status_ = value; - // @@protoc_insertion_point(field_set:cobalt.speech.proto.SpeechRecognitionEvent.status) -} - -// repeated .cobalt.speech.proto.SpeechRecognitionResult result = 2; -int SpeechRecognitionEvent::result_size() const { - return result_.size(); -} -void SpeechRecognitionEvent::clear_result() { - result_.Clear(); -} -const ::cobalt::speech::proto::SpeechRecognitionResult& SpeechRecognitionEvent::result(int index) const { - // @@protoc_insertion_point(field_get:cobalt.speech.proto.SpeechRecognitionEvent.result) - return result_.Get(index); -} -::cobalt::speech::proto::SpeechRecognitionResult* SpeechRecognitionEvent::mutable_result(int index) { - // @@protoc_insertion_point(field_mutable:cobalt.speech.proto.SpeechRecognitionEvent.result) - return result_.Mutable(index); -} -::cobalt::speech::proto::SpeechRecognitionResult* SpeechRecognitionEvent::add_result() { - // @@protoc_insertion_point(field_add:cobalt.speech.proto.SpeechRecognitionEvent.result) - return result_.Add(); -} -::google::protobuf::RepeatedPtrField< ::cobalt::speech::proto::SpeechRecognitionResult >* -SpeechRecognitionEvent::mutable_result() { - // @@protoc_insertion_point(field_mutable_list:cobalt.speech.proto.SpeechRecognitionEvent.result) - return &result_; -} -const ::google::protobuf::RepeatedPtrField< ::cobalt::speech::proto::SpeechRecognitionResult >& -SpeechRecognitionEvent::result() const { - // @@protoc_insertion_point(field_list:cobalt.speech.proto.SpeechRecognitionEvent.result) - return result_; -} - -// optional .cobalt.speech.proto.SpeechRecognitionEvent.EndpointerEventType endpoint = 4; -bool SpeechRecognitionEvent::has_endpoint() const { - return (_has_bits_[0] & 0x00000004u) != 0; -} -void SpeechRecognitionEvent::set_has_endpoint() { - _has_bits_[0] |= 0x00000004u; -} -void SpeechRecognitionEvent::clear_has_endpoint() { - _has_bits_[0] &= ~0x00000004u; -} -void SpeechRecognitionEvent::clear_endpoint() { - endpoint_ = 0; - clear_has_endpoint(); -} - ::cobalt::speech::proto::SpeechRecognitionEvent_EndpointerEventType SpeechRecognitionEvent::endpoint() const { - // @@protoc_insertion_point(field_get:cobalt.speech.proto.SpeechRecognitionEvent.endpoint) - return static_cast< ::cobalt::speech::proto::SpeechRecognitionEvent_EndpointerEventType >(endpoint_); -} - void SpeechRecognitionEvent::set_endpoint(::cobalt::speech::proto::SpeechRecognitionEvent_EndpointerEventType value) { - assert(::cobalt::speech::proto::SpeechRecognitionEvent_EndpointerEventType_IsValid(value)); - set_has_endpoint(); - endpoint_ = value; - // @@protoc_insertion_point(field_set:cobalt.speech.proto.SpeechRecognitionEvent.endpoint) -} - -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS - -// =================================================================== - -static ::std::string* MutableUnknownFieldsForSpeechRecognitionResult( - SpeechRecognitionResult* ptr) { - return ptr->mutable_unknown_fields(); -} - -#if !defined(_MSC_VER) || _MSC_VER >= 1900 -const int SpeechRecognitionResult::kAlternativeFieldNumber; -const int SpeechRecognitionResult::kFinalFieldNumber; -const int SpeechRecognitionResult::kStabilityFieldNumber; -#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 - -SpeechRecognitionResult::SpeechRecognitionResult() - : ::google::protobuf::MessageLite(), _arena_ptr_(NULL) { - SharedCtor(); - // @@protoc_insertion_point(constructor:cobalt.speech.proto.SpeechRecognitionResult) -} - -void SpeechRecognitionResult::InitAsDefaultInstance() { -} - -SpeechRecognitionResult::SpeechRecognitionResult(const SpeechRecognitionResult& from) - : ::google::protobuf::MessageLite(), - _arena_ptr_(NULL) { - SharedCtor(); - MergeFrom(from); - // @@protoc_insertion_point(copy_constructor:cobalt.speech.proto.SpeechRecognitionResult) -} - -void SpeechRecognitionResult::SharedCtor() { - ::google::protobuf::internal::GetEmptyString(); - _cached_size_ = 0; - _unknown_fields_.UnsafeSetDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - final_ = false; - stability_ = 0; - ::memset(_has_bits_, 0, sizeof(_has_bits_)); -} - -SpeechRecognitionResult::~SpeechRecognitionResult() { - // @@protoc_insertion_point(destructor:cobalt.speech.proto.SpeechRecognitionResult) - SharedDtor(); -} - -void SpeechRecognitionResult::SharedDtor() { - _unknown_fields_.DestroyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - if (this != &default_instance()) { - #else - if (this != default_instance_) { - #endif - } -} - -void SpeechRecognitionResult::SetCachedSize(int size) const { - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); -} -const SpeechRecognitionResult& SpeechRecognitionResult::default_instance() { -#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - protobuf_AddDesc_google_5fstreaming_5fapi_2eproto(); -#else - if (default_instance_ == NULL) protobuf_AddDesc_google_5fstreaming_5fapi_2eproto(); -#endif - return *default_instance_; -} - -SpeechRecognitionResult* SpeechRecognitionResult::default_instance_ = NULL; - -SpeechRecognitionResult* SpeechRecognitionResult::New(::google::protobuf::Arena* arena) const { - SpeechRecognitionResult* n = new SpeechRecognitionResult; - if (arena != NULL) { - arena->Own(n); - } - return n; -} - -void SpeechRecognitionResult::Clear() { -// @@protoc_insertion_point(message_clear_start:cobalt.speech.proto.SpeechRecognitionResult) -#if defined(__clang__) -#define ZR_HELPER_(f) \ - _Pragma("clang diagnostic push") \ - _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ - __builtin_offsetof(SpeechRecognitionResult, f) \ - _Pragma("clang diagnostic pop") -#else -#define ZR_HELPER_(f) reinterpret_cast(\ - &reinterpret_cast(16)->f) -#endif - -#define ZR_(first, last) do {\ - ::memset(&first, 0,\ - ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ -} while (0) - - ZR_(final_, stability_); - -#undef ZR_HELPER_ -#undef ZR_ - - alternative_.Clear(); - ::memset(_has_bits_, 0, sizeof(_has_bits_)); - _unknown_fields_.ClearToEmptyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} - -bool SpeechRecognitionResult::MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure - ::google::protobuf::uint32 tag; - ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( - ::google::protobuf::internal::NewPermanentCallback( - &MutableUnknownFieldsForSpeechRecognitionResult, this)); - ::google::protobuf::io::CodedOutputStream unknown_fields_stream( - &unknown_fields_string, false); - // @@protoc_insertion_point(parse_start:cobalt.speech.proto.SpeechRecognitionResult) - for (;;) { - ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // repeated .cobalt.speech.proto.SpeechRecognitionAlternative alternative = 1; - case 1: { - if (tag == 10) { - DO_(input->IncrementRecursionDepth()); - parse_loop_alternative: - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( - input, add_alternative())); - } else { - goto handle_unusual; - } - if (input->ExpectTag(10)) goto parse_loop_alternative; - input->UnsafeDecrementRecursionDepth(); - if (input->ExpectTag(16)) goto parse_final; - break; - } - - // optional bool final = 2 [default = false]; - case 2: { - if (tag == 16) { - parse_final: - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( - input, &final_))); - set_has_final(); - } else { - goto handle_unusual; - } - if (input->ExpectTag(29)) goto parse_stability; - break; - } - - // optional float stability = 3; - case 3: { - if (tag == 29) { - parse_stability: - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( - input, &stability_))); - set_has_stability(); - } else { - goto handle_unusual; - } - if (input->ExpectAtEnd()) goto success; - break; - } - - default: { - handle_unusual: - if (tag == 0 || - ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - goto success; - } - DO_(::google::protobuf::internal::WireFormatLite::SkipField( - input, tag, &unknown_fields_stream)); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:cobalt.speech.proto.SpeechRecognitionResult) - return true; -failure: - // @@protoc_insertion_point(parse_failure:cobalt.speech.proto.SpeechRecognitionResult) - return false; -#undef DO_ -} - -void SpeechRecognitionResult::SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:cobalt.speech.proto.SpeechRecognitionResult) - // repeated .cobalt.speech.proto.SpeechRecognitionAlternative alternative = 1; - for (unsigned int i = 0, n = this->alternative_size(); i < n; i++) { - ::google::protobuf::internal::WireFormatLite::WriteMessage( - 1, this->alternative(i), output); - } - - // optional bool final = 2 [default = false]; - if (has_final()) { - ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->final(), output); - } - - // optional float stability = 3; - if (has_stability()) { - ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->stability(), output); - } - - output->WriteRaw(unknown_fields().data(), - static_cast(unknown_fields().size())); - // @@protoc_insertion_point(serialize_end:cobalt.speech.proto.SpeechRecognitionResult) -} - -int SpeechRecognitionResult::ByteSize() const { -// @@protoc_insertion_point(message_byte_size_start:cobalt.speech.proto.SpeechRecognitionResult) - int total_size = 0; - - if (_has_bits_[1 / 32] & 6u) { - // optional bool final = 2 [default = false]; - if (has_final()) { - total_size += 1 + 1; - } - - // optional float stability = 3; - if (has_stability()) { - total_size += 1 + 4; - } - - } - // repeated .cobalt.speech.proto.SpeechRecognitionAlternative alternative = 1; - total_size += 1 * this->alternative_size(); - for (int i = 0; i < this->alternative_size(); i++) { - total_size += - ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( - this->alternative(i)); - } - - total_size += unknown_fields().size(); - - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = total_size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); - return total_size; -} - -void SpeechRecognitionResult::CheckTypeAndMergeFrom( - const ::google::protobuf::MessageLite& from) { - MergeFrom(*::google::protobuf::down_cast(&from)); -} - -void SpeechRecognitionResult::MergeFrom(const SpeechRecognitionResult& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:cobalt.speech.proto.SpeechRecognitionResult) - if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); - alternative_.MergeFrom(from.alternative_); - if (from._has_bits_[1 / 32] & (0xffu << (1 % 32))) { - if (from.has_final()) { - set_final(from.final()); - } - if (from.has_stability()) { - set_stability(from.stability()); - } - } - if (!from.unknown_fields().empty()) { - mutable_unknown_fields()->append(from.unknown_fields()); - } -} - -void SpeechRecognitionResult::CopyFrom(const SpeechRecognitionResult& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:cobalt.speech.proto.SpeechRecognitionResult) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool SpeechRecognitionResult::IsInitialized() const { - - return true; -} - -void SpeechRecognitionResult::Swap(SpeechRecognitionResult* other) { - if (other == this) return; - InternalSwap(other); -} -void SpeechRecognitionResult::InternalSwap(SpeechRecognitionResult* other) { - alternative_.UnsafeArenaSwap(&other->alternative_); - std::swap(final_, other->final_); - std::swap(stability_, other->stability_); - std::swap(_has_bits_[0], other->_has_bits_[0]); - _unknown_fields_.Swap(&other->_unknown_fields_); - std::swap(_cached_size_, other->_cached_size_); -} - -::std::string SpeechRecognitionResult::GetTypeName() const { - return "cobalt.speech.proto.SpeechRecognitionResult"; -} - -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// SpeechRecognitionResult - -// repeated .cobalt.speech.proto.SpeechRecognitionAlternative alternative = 1; -int SpeechRecognitionResult::alternative_size() const { - return alternative_.size(); -} -void SpeechRecognitionResult::clear_alternative() { - alternative_.Clear(); -} -const ::cobalt::speech::proto::SpeechRecognitionAlternative& SpeechRecognitionResult::alternative(int index) const { - // @@protoc_insertion_point(field_get:cobalt.speech.proto.SpeechRecognitionResult.alternative) - return alternative_.Get(index); -} -::cobalt::speech::proto::SpeechRecognitionAlternative* SpeechRecognitionResult::mutable_alternative(int index) { - // @@protoc_insertion_point(field_mutable:cobalt.speech.proto.SpeechRecognitionResult.alternative) - return alternative_.Mutable(index); -} -::cobalt::speech::proto::SpeechRecognitionAlternative* SpeechRecognitionResult::add_alternative() { - // @@protoc_insertion_point(field_add:cobalt.speech.proto.SpeechRecognitionResult.alternative) - return alternative_.Add(); -} -::google::protobuf::RepeatedPtrField< ::cobalt::speech::proto::SpeechRecognitionAlternative >* -SpeechRecognitionResult::mutable_alternative() { - // @@protoc_insertion_point(field_mutable_list:cobalt.speech.proto.SpeechRecognitionResult.alternative) - return &alternative_; -} -const ::google::protobuf::RepeatedPtrField< ::cobalt::speech::proto::SpeechRecognitionAlternative >& -SpeechRecognitionResult::alternative() const { - // @@protoc_insertion_point(field_list:cobalt.speech.proto.SpeechRecognitionResult.alternative) - return alternative_; -} - -// optional bool final = 2 [default = false]; -bool SpeechRecognitionResult::has_final() const { - return (_has_bits_[0] & 0x00000002u) != 0; -} -void SpeechRecognitionResult::set_has_final() { - _has_bits_[0] |= 0x00000002u; -} -void SpeechRecognitionResult::clear_has_final() { - _has_bits_[0] &= ~0x00000002u; -} -void SpeechRecognitionResult::clear_final() { - final_ = false; - clear_has_final(); -} - bool SpeechRecognitionResult::final() const { - // @@protoc_insertion_point(field_get:cobalt.speech.proto.SpeechRecognitionResult.final) - return final_; -} - void SpeechRecognitionResult::set_final(bool value) { - set_has_final(); - final_ = value; - // @@protoc_insertion_point(field_set:cobalt.speech.proto.SpeechRecognitionResult.final) -} - -// optional float stability = 3; -bool SpeechRecognitionResult::has_stability() const { - return (_has_bits_[0] & 0x00000004u) != 0; -} -void SpeechRecognitionResult::set_has_stability() { - _has_bits_[0] |= 0x00000004u; -} -void SpeechRecognitionResult::clear_has_stability() { - _has_bits_[0] &= ~0x00000004u; -} -void SpeechRecognitionResult::clear_stability() { - stability_ = 0; - clear_has_stability(); -} - float SpeechRecognitionResult::stability() const { - // @@protoc_insertion_point(field_get:cobalt.speech.proto.SpeechRecognitionResult.stability) - return stability_; -} - void SpeechRecognitionResult::set_stability(float value) { - set_has_stability(); - stability_ = value; - // @@protoc_insertion_point(field_set:cobalt.speech.proto.SpeechRecognitionResult.stability) -} - -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS - -// =================================================================== - -static ::std::string* MutableUnknownFieldsForSpeechRecognitionAlternative( - SpeechRecognitionAlternative* ptr) { - return ptr->mutable_unknown_fields(); -} - -#if !defined(_MSC_VER) || _MSC_VER >= 1900 -const int SpeechRecognitionAlternative::kTranscriptFieldNumber; -const int SpeechRecognitionAlternative::kConfidenceFieldNumber; -#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 - -SpeechRecognitionAlternative::SpeechRecognitionAlternative() - : ::google::protobuf::MessageLite(), _arena_ptr_(NULL) { - SharedCtor(); - // @@protoc_insertion_point(constructor:cobalt.speech.proto.SpeechRecognitionAlternative) -} - -void SpeechRecognitionAlternative::InitAsDefaultInstance() { -} - -SpeechRecognitionAlternative::SpeechRecognitionAlternative(const SpeechRecognitionAlternative& from) - : ::google::protobuf::MessageLite(), - _arena_ptr_(NULL) { - SharedCtor(); - MergeFrom(from); - // @@protoc_insertion_point(copy_constructor:cobalt.speech.proto.SpeechRecognitionAlternative) -} - -void SpeechRecognitionAlternative::SharedCtor() { - ::google::protobuf::internal::GetEmptyString(); - _cached_size_ = 0; - _unknown_fields_.UnsafeSetDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - transcript_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - confidence_ = 0; - ::memset(_has_bits_, 0, sizeof(_has_bits_)); -} - -SpeechRecognitionAlternative::~SpeechRecognitionAlternative() { - // @@protoc_insertion_point(destructor:cobalt.speech.proto.SpeechRecognitionAlternative) - SharedDtor(); -} - -void SpeechRecognitionAlternative::SharedDtor() { - _unknown_fields_.DestroyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - transcript_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - if (this != &default_instance()) { - #else - if (this != default_instance_) { - #endif - } -} - -void SpeechRecognitionAlternative::SetCachedSize(int size) const { - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); -} -const SpeechRecognitionAlternative& SpeechRecognitionAlternative::default_instance() { -#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - protobuf_AddDesc_google_5fstreaming_5fapi_2eproto(); -#else - if (default_instance_ == NULL) protobuf_AddDesc_google_5fstreaming_5fapi_2eproto(); -#endif - return *default_instance_; -} - -SpeechRecognitionAlternative* SpeechRecognitionAlternative::default_instance_ = NULL; - -SpeechRecognitionAlternative* SpeechRecognitionAlternative::New(::google::protobuf::Arena* arena) const { - SpeechRecognitionAlternative* n = new SpeechRecognitionAlternative; - if (arena != NULL) { - arena->Own(n); - } - return n; -} - -void SpeechRecognitionAlternative::Clear() { -// @@protoc_insertion_point(message_clear_start:cobalt.speech.proto.SpeechRecognitionAlternative) - if (_has_bits_[0 / 32] & 3u) { - if (has_transcript()) { - transcript_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - } - confidence_ = 0; - } - ::memset(_has_bits_, 0, sizeof(_has_bits_)); - _unknown_fields_.ClearToEmptyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} - -bool SpeechRecognitionAlternative::MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure - ::google::protobuf::uint32 tag; - ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( - ::google::protobuf::internal::NewPermanentCallback( - &MutableUnknownFieldsForSpeechRecognitionAlternative, this)); - ::google::protobuf::io::CodedOutputStream unknown_fields_stream( - &unknown_fields_string, false); - // @@protoc_insertion_point(parse_start:cobalt.speech.proto.SpeechRecognitionAlternative) - for (;;) { - ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // optional string transcript = 1; - case 1: { - if (tag == 10) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_transcript())); - } else { - goto handle_unusual; - } - if (input->ExpectTag(21)) goto parse_confidence; - break; - } - - // optional float confidence = 2; - case 2: { - if (tag == 21) { - parse_confidence: - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( - input, &confidence_))); - set_has_confidence(); - } else { - goto handle_unusual; - } - if (input->ExpectAtEnd()) goto success; - break; - } - - default: { - handle_unusual: - if (tag == 0 || - ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - goto success; - } - DO_(::google::protobuf::internal::WireFormatLite::SkipField( - input, tag, &unknown_fields_stream)); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:cobalt.speech.proto.SpeechRecognitionAlternative) - return true; -failure: - // @@protoc_insertion_point(parse_failure:cobalt.speech.proto.SpeechRecognitionAlternative) - return false; -#undef DO_ -} - -void SpeechRecognitionAlternative::SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:cobalt.speech.proto.SpeechRecognitionAlternative) - // optional string transcript = 1; - if (has_transcript()) { - ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( - 1, this->transcript(), output); - } - - // optional float confidence = 2; - if (has_confidence()) { - ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->confidence(), output); - } - - output->WriteRaw(unknown_fields().data(), - static_cast(unknown_fields().size())); - // @@protoc_insertion_point(serialize_end:cobalt.speech.proto.SpeechRecognitionAlternative) -} - -int SpeechRecognitionAlternative::ByteSize() const { -// @@protoc_insertion_point(message_byte_size_start:cobalt.speech.proto.SpeechRecognitionAlternative) - int total_size = 0; - - if (_has_bits_[0 / 32] & 3u) { - // optional string transcript = 1; - if (has_transcript()) { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::StringSize( - this->transcript()); - } - - // optional float confidence = 2; - if (has_confidence()) { - total_size += 1 + 4; - } - - } - total_size += unknown_fields().size(); - - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = total_size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); - return total_size; -} - -void SpeechRecognitionAlternative::CheckTypeAndMergeFrom( - const ::google::protobuf::MessageLite& from) { - MergeFrom(*::google::protobuf::down_cast(&from)); -} - -void SpeechRecognitionAlternative::MergeFrom(const SpeechRecognitionAlternative& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:cobalt.speech.proto.SpeechRecognitionAlternative) - if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); - if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { - if (from.has_transcript()) { - set_has_transcript(); - transcript_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.transcript_); - } - if (from.has_confidence()) { - set_confidence(from.confidence()); - } - } - if (!from.unknown_fields().empty()) { - mutable_unknown_fields()->append(from.unknown_fields()); - } -} - -void SpeechRecognitionAlternative::CopyFrom(const SpeechRecognitionAlternative& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:cobalt.speech.proto.SpeechRecognitionAlternative) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool SpeechRecognitionAlternative::IsInitialized() const { - - return true; -} - -void SpeechRecognitionAlternative::Swap(SpeechRecognitionAlternative* other) { - if (other == this) return; - InternalSwap(other); -} -void SpeechRecognitionAlternative::InternalSwap(SpeechRecognitionAlternative* other) { - transcript_.Swap(&other->transcript_); - std::swap(confidence_, other->confidence_); - std::swap(_has_bits_[0], other->_has_bits_[0]); - _unknown_fields_.Swap(&other->_unknown_fields_); - std::swap(_cached_size_, other->_cached_size_); -} - -::std::string SpeechRecognitionAlternative::GetTypeName() const { - return "cobalt.speech.proto.SpeechRecognitionAlternative"; -} - -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// SpeechRecognitionAlternative - -// optional string transcript = 1; -bool SpeechRecognitionAlternative::has_transcript() const { - return (_has_bits_[0] & 0x00000001u) != 0; -} -void SpeechRecognitionAlternative::set_has_transcript() { - _has_bits_[0] |= 0x00000001u; -} -void SpeechRecognitionAlternative::clear_has_transcript() { - _has_bits_[0] &= ~0x00000001u; -} -void SpeechRecognitionAlternative::clear_transcript() { - transcript_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_transcript(); -} - const ::std::string& SpeechRecognitionAlternative::transcript() const { - // @@protoc_insertion_point(field_get:cobalt.speech.proto.SpeechRecognitionAlternative.transcript) - return transcript_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} - void SpeechRecognitionAlternative::set_transcript(const ::std::string& value) { - set_has_transcript(); - transcript_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:cobalt.speech.proto.SpeechRecognitionAlternative.transcript) -} - void SpeechRecognitionAlternative::set_transcript(const char* value) { - set_has_transcript(); - transcript_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:cobalt.speech.proto.SpeechRecognitionAlternative.transcript) -} - void SpeechRecognitionAlternative::set_transcript(const char* value, size_t size) { - set_has_transcript(); - transcript_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:cobalt.speech.proto.SpeechRecognitionAlternative.transcript) -} - ::std::string* SpeechRecognitionAlternative::mutable_transcript() { - set_has_transcript(); - // @@protoc_insertion_point(field_mutable:cobalt.speech.proto.SpeechRecognitionAlternative.transcript) - return transcript_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} - ::std::string* SpeechRecognitionAlternative::release_transcript() { - // @@protoc_insertion_point(field_release:cobalt.speech.proto.SpeechRecognitionAlternative.transcript) - clear_has_transcript(); - return transcript_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} - void SpeechRecognitionAlternative::set_allocated_transcript(::std::string* transcript) { - if (transcript != NULL) { - set_has_transcript(); - } else { - clear_has_transcript(); - } - transcript_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), transcript); - // @@protoc_insertion_point(field_set_allocated:cobalt.speech.proto.SpeechRecognitionAlternative.transcript) -} - -// optional float confidence = 2; -bool SpeechRecognitionAlternative::has_confidence() const { - return (_has_bits_[0] & 0x00000002u) != 0; -} -void SpeechRecognitionAlternative::set_has_confidence() { - _has_bits_[0] |= 0x00000002u; -} -void SpeechRecognitionAlternative::clear_has_confidence() { - _has_bits_[0] &= ~0x00000002u; -} -void SpeechRecognitionAlternative::clear_confidence() { - confidence_ = 0; - clear_has_confidence(); -} - float SpeechRecognitionAlternative::confidence() const { - // @@protoc_insertion_point(field_get:cobalt.speech.proto.SpeechRecognitionAlternative.confidence) - return confidence_; -} - void SpeechRecognitionAlternative::set_confidence(float value) { - set_has_confidence(); - confidence_ = value; - // @@protoc_insertion_point(field_set:cobalt.speech.proto.SpeechRecognitionAlternative.confidence) -} - -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS - -// @@protoc_insertion_point(namespace_scope) - -} // namespace proto -} // namespace speech -} // namespace cobalt - -// @@protoc_insertion_point(global_scope) diff --git a/cobalt/speech/google_streaming_api.pb.h b/cobalt/speech/google_streaming_api.pb.h deleted file mode 100644 index 48190d7c61ec..000000000000 --- a/cobalt/speech/google_streaming_api.pb.h +++ /dev/null @@ -1,846 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google_streaming_api.proto - -#ifndef PROTOBUF_google_5fstreaming_5fapi_2eproto__INCLUDED -#define PROTOBUF_google_5fstreaming_5fapi_2eproto__INCLUDED - -#include - -#include - -#if GOOGLE_PROTOBUF_VERSION < 3000000 -#error This file was generated by a newer version of protoc which is -#error incompatible with your Protocol Buffer headers. Please update -#error your headers. -#endif -#if 3000000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION -#error This file was generated by an older version of protoc which is -#error incompatible with your Protocol Buffer headers. Please -#error regenerate this file with a newer version of protoc. -#endif - -#include -#include -#include -#include -#include -#include -#include -// @@protoc_insertion_point(includes) - -namespace cobalt { -namespace speech { -namespace proto { - -// Internal implementation detail -- do not call these. -void protobuf_AddDesc_google_5fstreaming_5fapi_2eproto(); -void protobuf_AssignDesc_google_5fstreaming_5fapi_2eproto(); -void protobuf_ShutdownFile_google_5fstreaming_5fapi_2eproto(); - -class SpeechRecognitionAlternative; -class SpeechRecognitionEvent; -class SpeechRecognitionResult; - -enum SpeechRecognitionEvent_StatusCode { - SpeechRecognitionEvent_StatusCode_STATUS_SUCCESS = 0, - SpeechRecognitionEvent_StatusCode_STATUS_NO_SPEECH = 1, - SpeechRecognitionEvent_StatusCode_STATUS_ABORTED = 2, - SpeechRecognitionEvent_StatusCode_STATUS_AUDIO_CAPTURE = 3, - SpeechRecognitionEvent_StatusCode_STATUS_NETWORK = 4, - SpeechRecognitionEvent_StatusCode_STATUS_NOT_ALLOWED = 5, - SpeechRecognitionEvent_StatusCode_STATUS_SERVICE_NOT_ALLOWED = 6, - SpeechRecognitionEvent_StatusCode_STATUS_BAD_GRAMMAR = 7, - SpeechRecognitionEvent_StatusCode_STATUS_LANGUAGE_NOT_SUPPORTED = 8 -}; -bool SpeechRecognitionEvent_StatusCode_IsValid(int value); -const SpeechRecognitionEvent_StatusCode - SpeechRecognitionEvent_StatusCode_StatusCode_MIN = - SpeechRecognitionEvent_StatusCode_STATUS_SUCCESS; -const SpeechRecognitionEvent_StatusCode - SpeechRecognitionEvent_StatusCode_StatusCode_MAX = - SpeechRecognitionEvent_StatusCode_STATUS_LANGUAGE_NOT_SUPPORTED; -const int SpeechRecognitionEvent_StatusCode_StatusCode_ARRAYSIZE = - SpeechRecognitionEvent_StatusCode_StatusCode_MAX + 1; - -enum SpeechRecognitionEvent_EndpointerEventType { - SpeechRecognitionEvent_EndpointerEventType_START_OF_SPEECH = 0, - SpeechRecognitionEvent_EndpointerEventType_END_OF_SPEECH = 1, - SpeechRecognitionEvent_EndpointerEventType_END_OF_AUDIO = 2, - SpeechRecognitionEvent_EndpointerEventType_END_OF_UTTERANCE = 3 -}; -bool SpeechRecognitionEvent_EndpointerEventType_IsValid(int value); -const SpeechRecognitionEvent_EndpointerEventType - SpeechRecognitionEvent_EndpointerEventType_EndpointerEventType_MIN = - SpeechRecognitionEvent_EndpointerEventType_START_OF_SPEECH; -const SpeechRecognitionEvent_EndpointerEventType - SpeechRecognitionEvent_EndpointerEventType_EndpointerEventType_MAX = - SpeechRecognitionEvent_EndpointerEventType_END_OF_UTTERANCE; -const int - SpeechRecognitionEvent_EndpointerEventType_EndpointerEventType_ARRAYSIZE = - SpeechRecognitionEvent_EndpointerEventType_EndpointerEventType_MAX + 1; - -// =================================================================== - -class SpeechRecognitionEvent : public ::google::protobuf::MessageLite { - public: - SpeechRecognitionEvent(); - virtual ~SpeechRecognitionEvent(); - - SpeechRecognitionEvent(const SpeechRecognitionEvent& from); - - inline SpeechRecognitionEvent& operator=(const SpeechRecognitionEvent& from) { - CopyFrom(from); - return *this; - } - - inline const ::std::string& unknown_fields() const { - return _unknown_fields_.GetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - } - - inline ::std::string* mutable_unknown_fields() { - return _unknown_fields_.MutableNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - } - - static const SpeechRecognitionEvent& default_instance(); - -#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - // Returns the internal default instance pointer. This function can - // return NULL thus should not be used by the user. This is intended - // for Protobuf internal code. Please use default_instance() declared - // above instead. - static inline const SpeechRecognitionEvent* internal_default_instance() { - return default_instance_; - } -#endif - - GOOGLE_ATTRIBUTE_NOINLINE void Swap(SpeechRecognitionEvent* other); - - // implements Message ---------------------------------------------- - - inline SpeechRecognitionEvent* New() const { return New(NULL); } - - SpeechRecognitionEvent* New(::google::protobuf::Arena* arena) const; - void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); - void CopyFrom(const SpeechRecognitionEvent& from); - void MergeFrom(const SpeechRecognitionEvent& from); - void Clear(); - bool IsInitialized() const; - - int ByteSize() const; - bool MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream* input); - void SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream* output) const; - void DiscardUnknownFields(); - int GetCachedSize() const { return _cached_size_; } - - private: - void SharedCtor(); - void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(SpeechRecognitionEvent* other); - - private: - inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return _arena_ptr_; - } - inline ::google::protobuf::Arena* MaybeArenaPtr() const { - return _arena_ptr_; - } - - public: - ::std::string GetTypeName() const; - - // nested types ---------------------------------------------------- - - typedef SpeechRecognitionEvent_StatusCode StatusCode; - static const StatusCode STATUS_SUCCESS = - SpeechRecognitionEvent_StatusCode_STATUS_SUCCESS; - static const StatusCode STATUS_NO_SPEECH = - SpeechRecognitionEvent_StatusCode_STATUS_NO_SPEECH; - static const StatusCode STATUS_ABORTED = - SpeechRecognitionEvent_StatusCode_STATUS_ABORTED; - static const StatusCode STATUS_AUDIO_CAPTURE = - SpeechRecognitionEvent_StatusCode_STATUS_AUDIO_CAPTURE; - static const StatusCode STATUS_NETWORK = - SpeechRecognitionEvent_StatusCode_STATUS_NETWORK; - static const StatusCode STATUS_NOT_ALLOWED = - SpeechRecognitionEvent_StatusCode_STATUS_NOT_ALLOWED; - static const StatusCode STATUS_SERVICE_NOT_ALLOWED = - SpeechRecognitionEvent_StatusCode_STATUS_SERVICE_NOT_ALLOWED; - static const StatusCode STATUS_BAD_GRAMMAR = - SpeechRecognitionEvent_StatusCode_STATUS_BAD_GRAMMAR; - static const StatusCode STATUS_LANGUAGE_NOT_SUPPORTED = - SpeechRecognitionEvent_StatusCode_STATUS_LANGUAGE_NOT_SUPPORTED; - static inline bool StatusCode_IsValid(int value) { - return SpeechRecognitionEvent_StatusCode_IsValid(value); - } - static const StatusCode StatusCode_MIN = - SpeechRecognitionEvent_StatusCode_StatusCode_MIN; - static const StatusCode StatusCode_MAX = - SpeechRecognitionEvent_StatusCode_StatusCode_MAX; - static const int StatusCode_ARRAYSIZE = - SpeechRecognitionEvent_StatusCode_StatusCode_ARRAYSIZE; - - typedef SpeechRecognitionEvent_EndpointerEventType EndpointerEventType; - static const EndpointerEventType START_OF_SPEECH = - SpeechRecognitionEvent_EndpointerEventType_START_OF_SPEECH; - static const EndpointerEventType END_OF_SPEECH = - SpeechRecognitionEvent_EndpointerEventType_END_OF_SPEECH; - static const EndpointerEventType END_OF_AUDIO = - SpeechRecognitionEvent_EndpointerEventType_END_OF_AUDIO; - static const EndpointerEventType END_OF_UTTERANCE = - SpeechRecognitionEvent_EndpointerEventType_END_OF_UTTERANCE; - static inline bool EndpointerEventType_IsValid(int value) { - return SpeechRecognitionEvent_EndpointerEventType_IsValid(value); - } - static const EndpointerEventType EndpointerEventType_MIN = - SpeechRecognitionEvent_EndpointerEventType_EndpointerEventType_MIN; - static const EndpointerEventType EndpointerEventType_MAX = - SpeechRecognitionEvent_EndpointerEventType_EndpointerEventType_MAX; - static const int EndpointerEventType_ARRAYSIZE = - SpeechRecognitionEvent_EndpointerEventType_EndpointerEventType_ARRAYSIZE; - - // accessors ------------------------------------------------------- - - // optional .cobalt.speech.proto.SpeechRecognitionEvent.StatusCode status = 1 - // [default = STATUS_SUCCESS]; - bool has_status() const; - void clear_status(); - static const int kStatusFieldNumber = 1; - ::cobalt::speech::proto::SpeechRecognitionEvent_StatusCode status() const; - void set_status( - ::cobalt::speech::proto::SpeechRecognitionEvent_StatusCode value); - - // repeated .cobalt.speech.proto.SpeechRecognitionResult result = 2; - int result_size() const; - void clear_result(); - static const int kResultFieldNumber = 2; - const ::cobalt::speech::proto::SpeechRecognitionResult& result( - int index) const; - ::cobalt::speech::proto::SpeechRecognitionResult* mutable_result(int index); - ::cobalt::speech::proto::SpeechRecognitionResult* add_result(); - ::google::protobuf::RepeatedPtrField< - ::cobalt::speech::proto::SpeechRecognitionResult>* - mutable_result(); - const ::google::protobuf::RepeatedPtrField< - ::cobalt::speech::proto::SpeechRecognitionResult>& - result() const; - - // optional .cobalt.speech.proto.SpeechRecognitionEvent.EndpointerEventType - // endpoint = 4; - bool has_endpoint() const; - void clear_endpoint(); - static const int kEndpointFieldNumber = 4; - ::cobalt::speech::proto::SpeechRecognitionEvent_EndpointerEventType endpoint() - const; - void set_endpoint( - ::cobalt::speech::proto::SpeechRecognitionEvent_EndpointerEventType - value); - - // @@protoc_insertion_point(class_scope:cobalt.speech.proto.SpeechRecognitionEvent) - private: - inline void set_has_status(); - inline void clear_has_status(); - inline void set_has_endpoint(); - inline void clear_has_endpoint(); - - ::google::protobuf::internal::ArenaStringPtr _unknown_fields_; - ::google::protobuf::Arena* _arena_ptr_; - - ::google::protobuf::uint32 _has_bits_[1]; - mutable int _cached_size_; - ::google::protobuf::RepeatedPtrField< - ::cobalt::speech::proto::SpeechRecognitionResult> - result_; - int status_; - int endpoint_; -#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - friend void protobuf_AddDesc_google_5fstreaming_5fapi_2eproto_impl(); -#else - friend void protobuf_AddDesc_google_5fstreaming_5fapi_2eproto(); -#endif - friend void protobuf_AssignDesc_google_5fstreaming_5fapi_2eproto(); - friend void protobuf_ShutdownFile_google_5fstreaming_5fapi_2eproto(); - - void InitAsDefaultInstance(); - static SpeechRecognitionEvent* default_instance_; -}; -// ------------------------------------------------------------------- - -class SpeechRecognitionResult : public ::google::protobuf::MessageLite { - public: - SpeechRecognitionResult(); - virtual ~SpeechRecognitionResult(); - - SpeechRecognitionResult(const SpeechRecognitionResult& from); - - inline SpeechRecognitionResult& operator=( - const SpeechRecognitionResult& from) { - CopyFrom(from); - return *this; - } - - inline const ::std::string& unknown_fields() const { - return _unknown_fields_.GetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - } - - inline ::std::string* mutable_unknown_fields() { - return _unknown_fields_.MutableNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - } - - static const SpeechRecognitionResult& default_instance(); - -#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - // Returns the internal default instance pointer. This function can - // return NULL thus should not be used by the user. This is intended - // for Protobuf internal code. Please use default_instance() declared - // above instead. - static inline const SpeechRecognitionResult* internal_default_instance() { - return default_instance_; - } -#endif - - GOOGLE_ATTRIBUTE_NOINLINE void Swap(SpeechRecognitionResult* other); - - // implements Message ---------------------------------------------- - - inline SpeechRecognitionResult* New() const { return New(NULL); } - - SpeechRecognitionResult* New(::google::protobuf::Arena* arena) const; - void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); - void CopyFrom(const SpeechRecognitionResult& from); - void MergeFrom(const SpeechRecognitionResult& from); - void Clear(); - bool IsInitialized() const; - - int ByteSize() const; - bool MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream* input); - void SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream* output) const; - void DiscardUnknownFields(); - int GetCachedSize() const { return _cached_size_; } - - private: - void SharedCtor(); - void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(SpeechRecognitionResult* other); - - private: - inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return _arena_ptr_; - } - inline ::google::protobuf::Arena* MaybeArenaPtr() const { - return _arena_ptr_; - } - - public: - ::std::string GetTypeName() const; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - // repeated .cobalt.speech.proto.SpeechRecognitionAlternative alternative = 1; - int alternative_size() const; - void clear_alternative(); - static const int kAlternativeFieldNumber = 1; - const ::cobalt::speech::proto::SpeechRecognitionAlternative& alternative( - int index) const; - ::cobalt::speech::proto::SpeechRecognitionAlternative* mutable_alternative( - int index); - ::cobalt::speech::proto::SpeechRecognitionAlternative* add_alternative(); - ::google::protobuf::RepeatedPtrField< - ::cobalt::speech::proto::SpeechRecognitionAlternative>* - mutable_alternative(); - const ::google::protobuf::RepeatedPtrField< - ::cobalt::speech::proto::SpeechRecognitionAlternative>& - alternative() const; - - // optional bool final = 2 [default = false]; - bool has_final() const; - void clear_final(); - static const int kFinalFieldNumber = 2; - bool final() const; - void set_final(bool value); - - // optional float stability = 3; - bool has_stability() const; - void clear_stability(); - static const int kStabilityFieldNumber = 3; - float stability() const; - void set_stability(float value); - - // @@protoc_insertion_point(class_scope:cobalt.speech.proto.SpeechRecognitionResult) - private: - inline void set_has_final(); - inline void clear_has_final(); - inline void set_has_stability(); - inline void clear_has_stability(); - - ::google::protobuf::internal::ArenaStringPtr _unknown_fields_; - ::google::protobuf::Arena* _arena_ptr_; - - ::google::protobuf::uint32 _has_bits_[1]; - mutable int _cached_size_; - ::google::protobuf::RepeatedPtrField< - ::cobalt::speech::proto::SpeechRecognitionAlternative> - alternative_; - bool final_; - float stability_; -#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - friend void protobuf_AddDesc_google_5fstreaming_5fapi_2eproto_impl(); -#else - friend void protobuf_AddDesc_google_5fstreaming_5fapi_2eproto(); -#endif - friend void protobuf_AssignDesc_google_5fstreaming_5fapi_2eproto(); - friend void protobuf_ShutdownFile_google_5fstreaming_5fapi_2eproto(); - - void InitAsDefaultInstance(); - static SpeechRecognitionResult* default_instance_; -}; -// ------------------------------------------------------------------- - -class SpeechRecognitionAlternative : public ::google::protobuf::MessageLite { - public: - SpeechRecognitionAlternative(); - virtual ~SpeechRecognitionAlternative(); - - SpeechRecognitionAlternative(const SpeechRecognitionAlternative& from); - - inline SpeechRecognitionAlternative& operator=( - const SpeechRecognitionAlternative& from) { - CopyFrom(from); - return *this; - } - - inline const ::std::string& unknown_fields() const { - return _unknown_fields_.GetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - } - - inline ::std::string* mutable_unknown_fields() { - return _unknown_fields_.MutableNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - } - - static const SpeechRecognitionAlternative& default_instance(); - -#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - // Returns the internal default instance pointer. This function can - // return NULL thus should not be used by the user. This is intended - // for Protobuf internal code. Please use default_instance() declared - // above instead. - static inline const SpeechRecognitionAlternative* - internal_default_instance() { - return default_instance_; - } -#endif - - GOOGLE_ATTRIBUTE_NOINLINE void Swap(SpeechRecognitionAlternative* other); - - // implements Message ---------------------------------------------- - - inline SpeechRecognitionAlternative* New() const { return New(NULL); } - - SpeechRecognitionAlternative* New(::google::protobuf::Arena* arena) const; - void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); - void CopyFrom(const SpeechRecognitionAlternative& from); - void MergeFrom(const SpeechRecognitionAlternative& from); - void Clear(); - bool IsInitialized() const; - - int ByteSize() const; - bool MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream* input); - void SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream* output) const; - void DiscardUnknownFields(); - int GetCachedSize() const { return _cached_size_; } - - private: - void SharedCtor(); - void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(SpeechRecognitionAlternative* other); - - private: - inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return _arena_ptr_; - } - inline ::google::protobuf::Arena* MaybeArenaPtr() const { - return _arena_ptr_; - } - - public: - ::std::string GetTypeName() const; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - // optional string transcript = 1; - bool has_transcript() const; - void clear_transcript(); - static const int kTranscriptFieldNumber = 1; - const ::std::string& transcript() const; - void set_transcript(const ::std::string& value); - void set_transcript(const char* value); - void set_transcript(const char* value, size_t size); - ::std::string* mutable_transcript(); - ::std::string* release_transcript(); - void set_allocated_transcript(::std::string* transcript); - - // optional float confidence = 2; - bool has_confidence() const; - void clear_confidence(); - static const int kConfidenceFieldNumber = 2; - float confidence() const; - void set_confidence(float value); - - // @@protoc_insertion_point(class_scope:cobalt.speech.proto.SpeechRecognitionAlternative) - private: - inline void set_has_transcript(); - inline void clear_has_transcript(); - inline void set_has_confidence(); - inline void clear_has_confidence(); - - ::google::protobuf::internal::ArenaStringPtr _unknown_fields_; - ::google::protobuf::Arena* _arena_ptr_; - - ::google::protobuf::uint32 _has_bits_[1]; - mutable int _cached_size_; - ::google::protobuf::internal::ArenaStringPtr transcript_; - float confidence_; -#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - friend void protobuf_AddDesc_google_5fstreaming_5fapi_2eproto_impl(); -#else - friend void protobuf_AddDesc_google_5fstreaming_5fapi_2eproto(); -#endif - friend void protobuf_AssignDesc_google_5fstreaming_5fapi_2eproto(); - friend void protobuf_ShutdownFile_google_5fstreaming_5fapi_2eproto(); - - void InitAsDefaultInstance(); - static SpeechRecognitionAlternative* default_instance_; -}; -// =================================================================== - - -// =================================================================== - -#if !PROTOBUF_INLINE_NOT_IN_HEADERS -// SpeechRecognitionEvent - -// optional .cobalt.speech.proto.SpeechRecognitionEvent.StatusCode status = 1 -// [default = STATUS_SUCCESS]; -inline bool SpeechRecognitionEvent::has_status() const { - return (_has_bits_[0] & 0x00000001u) != 0; -} -inline void SpeechRecognitionEvent::set_has_status() { - _has_bits_[0] |= 0x00000001u; -} -inline void SpeechRecognitionEvent::clear_has_status() { - _has_bits_[0] &= ~0x00000001u; -} -inline void SpeechRecognitionEvent::clear_status() { - status_ = 0; - clear_has_status(); -} -inline ::cobalt::speech::proto::SpeechRecognitionEvent_StatusCode -SpeechRecognitionEvent::status() const { - // @@protoc_insertion_point(field_get:cobalt.speech.proto.SpeechRecognitionEvent.status) - return static_cast< - ::cobalt::speech::proto::SpeechRecognitionEvent_StatusCode>(status_); -} -inline void SpeechRecognitionEvent::set_status( - ::cobalt::speech::proto::SpeechRecognitionEvent_StatusCode value) { - assert(::cobalt::speech::proto::SpeechRecognitionEvent_StatusCode_IsValid( - value)); - set_has_status(); - status_ = value; - // @@protoc_insertion_point(field_set:cobalt.speech.proto.SpeechRecognitionEvent.status) -} - -// repeated .cobalt.speech.proto.SpeechRecognitionResult result = 2; -inline int SpeechRecognitionEvent::result_size() const { - return result_.size(); -} -inline void SpeechRecognitionEvent::clear_result() { result_.Clear(); } -inline const ::cobalt::speech::proto::SpeechRecognitionResult& -SpeechRecognitionEvent::result(int index) const { - // @@protoc_insertion_point(field_get:cobalt.speech.proto.SpeechRecognitionEvent.result) - return result_.Get(index); -} -inline ::cobalt::speech::proto::SpeechRecognitionResult* -SpeechRecognitionEvent::mutable_result(int index) { - // @@protoc_insertion_point(field_mutable:cobalt.speech.proto.SpeechRecognitionEvent.result) - return result_.Mutable(index); -} -inline ::cobalt::speech::proto::SpeechRecognitionResult* -SpeechRecognitionEvent::add_result() { - // @@protoc_insertion_point(field_add:cobalt.speech.proto.SpeechRecognitionEvent.result) - return result_.Add(); -} -inline ::google::protobuf::RepeatedPtrField< - ::cobalt::speech::proto::SpeechRecognitionResult>* -SpeechRecognitionEvent::mutable_result() { - // @@protoc_insertion_point(field_mutable_list:cobalt.speech.proto.SpeechRecognitionEvent.result) - return &result_; -} -inline const ::google::protobuf::RepeatedPtrField< - ::cobalt::speech::proto::SpeechRecognitionResult>& -SpeechRecognitionEvent::result() const { - // @@protoc_insertion_point(field_list:cobalt.speech.proto.SpeechRecognitionEvent.result) - return result_; -} - -// optional .cobalt.speech.proto.SpeechRecognitionEvent.EndpointerEventType -// endpoint = 4; -inline bool SpeechRecognitionEvent::has_endpoint() const { - return (_has_bits_[0] & 0x00000004u) != 0; -} -inline void SpeechRecognitionEvent::set_has_endpoint() { - _has_bits_[0] |= 0x00000004u; -} -inline void SpeechRecognitionEvent::clear_has_endpoint() { - _has_bits_[0] &= ~0x00000004u; -} -inline void SpeechRecognitionEvent::clear_endpoint() { - endpoint_ = 0; - clear_has_endpoint(); -} -inline ::cobalt::speech::proto::SpeechRecognitionEvent_EndpointerEventType -SpeechRecognitionEvent::endpoint() const { - // @@protoc_insertion_point(field_get:cobalt.speech.proto.SpeechRecognitionEvent.endpoint) - return static_cast< - ::cobalt::speech::proto::SpeechRecognitionEvent_EndpointerEventType>( - endpoint_); -} -inline void SpeechRecognitionEvent::set_endpoint( - ::cobalt::speech::proto::SpeechRecognitionEvent_EndpointerEventType value) { - assert(::cobalt::speech::proto:: - SpeechRecognitionEvent_EndpointerEventType_IsValid(value)); - set_has_endpoint(); - endpoint_ = value; - // @@protoc_insertion_point(field_set:cobalt.speech.proto.SpeechRecognitionEvent.endpoint) -} - -// ------------------------------------------------------------------- - -// SpeechRecognitionResult - -// repeated .cobalt.speech.proto.SpeechRecognitionAlternative alternative = 1; -inline int SpeechRecognitionResult::alternative_size() const { - return alternative_.size(); -} -inline void SpeechRecognitionResult::clear_alternative() { - alternative_.Clear(); -} -inline const ::cobalt::speech::proto::SpeechRecognitionAlternative& -SpeechRecognitionResult::alternative(int index) const { - // @@protoc_insertion_point(field_get:cobalt.speech.proto.SpeechRecognitionResult.alternative) - return alternative_.Get(index); -} -inline ::cobalt::speech::proto::SpeechRecognitionAlternative* -SpeechRecognitionResult::mutable_alternative(int index) { - // @@protoc_insertion_point(field_mutable:cobalt.speech.proto.SpeechRecognitionResult.alternative) - return alternative_.Mutable(index); -} -inline ::cobalt::speech::proto::SpeechRecognitionAlternative* -SpeechRecognitionResult::add_alternative() { - // @@protoc_insertion_point(field_add:cobalt.speech.proto.SpeechRecognitionResult.alternative) - return alternative_.Add(); -} -inline ::google::protobuf::RepeatedPtrField< - ::cobalt::speech::proto::SpeechRecognitionAlternative>* -SpeechRecognitionResult::mutable_alternative() { - // @@protoc_insertion_point(field_mutable_list:cobalt.speech.proto.SpeechRecognitionResult.alternative) - return &alternative_; -} -inline const ::google::protobuf::RepeatedPtrField< - ::cobalt::speech::proto::SpeechRecognitionAlternative>& -SpeechRecognitionResult::alternative() const { - // @@protoc_insertion_point(field_list:cobalt.speech.proto.SpeechRecognitionResult.alternative) - return alternative_; -} - -// optional bool final = 2 [default = false]; -inline bool SpeechRecognitionResult::has_final() const { - return (_has_bits_[0] & 0x00000002u) != 0; -} -inline void SpeechRecognitionResult::set_has_final() { - _has_bits_[0] |= 0x00000002u; -} -inline void SpeechRecognitionResult::clear_has_final() { - _has_bits_[0] &= ~0x00000002u; -} -inline void SpeechRecognitionResult::clear_final() { - final_ = false; - clear_has_final(); -} -inline bool SpeechRecognitionResult::final() const { - // @@protoc_insertion_point(field_get:cobalt.speech.proto.SpeechRecognitionResult.final) - return final_; -} -inline void SpeechRecognitionResult::set_final(bool value) { - set_has_final(); - final_ = value; - // @@protoc_insertion_point(field_set:cobalt.speech.proto.SpeechRecognitionResult.final) -} - -// optional float stability = 3; -inline bool SpeechRecognitionResult::has_stability() const { - return (_has_bits_[0] & 0x00000004u) != 0; -} -inline void SpeechRecognitionResult::set_has_stability() { - _has_bits_[0] |= 0x00000004u; -} -inline void SpeechRecognitionResult::clear_has_stability() { - _has_bits_[0] &= ~0x00000004u; -} -inline void SpeechRecognitionResult::clear_stability() { - stability_ = 0; - clear_has_stability(); -} -inline float SpeechRecognitionResult::stability() const { - // @@protoc_insertion_point(field_get:cobalt.speech.proto.SpeechRecognitionResult.stability) - return stability_; -} -inline void SpeechRecognitionResult::set_stability(float value) { - set_has_stability(); - stability_ = value; - // @@protoc_insertion_point(field_set:cobalt.speech.proto.SpeechRecognitionResult.stability) -} - -// ------------------------------------------------------------------- - -// SpeechRecognitionAlternative - -// optional string transcript = 1; -inline bool SpeechRecognitionAlternative::has_transcript() const { - return (_has_bits_[0] & 0x00000001u) != 0; -} -inline void SpeechRecognitionAlternative::set_has_transcript() { - _has_bits_[0] |= 0x00000001u; -} -inline void SpeechRecognitionAlternative::clear_has_transcript() { - _has_bits_[0] &= ~0x00000001u; -} -inline void SpeechRecognitionAlternative::clear_transcript() { - transcript_.ClearToEmptyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_transcript(); -} -inline const ::std::string& SpeechRecognitionAlternative::transcript() const { - // @@protoc_insertion_point(field_get:cobalt.speech.proto.SpeechRecognitionAlternative.transcript) - return transcript_.GetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -inline void SpeechRecognitionAlternative::set_transcript( - const ::std::string& value) { - set_has_transcript(); - transcript_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:cobalt.speech.proto.SpeechRecognitionAlternative.transcript) -} -inline void SpeechRecognitionAlternative::set_transcript(const char* value) { - set_has_transcript(); - transcript_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(value)); - // @@protoc_insertion_point(field_set_char:cobalt.speech.proto.SpeechRecognitionAlternative.transcript) -} -inline void SpeechRecognitionAlternative::set_transcript(const char* value, - size_t size) { - set_has_transcript(); - transcript_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:cobalt.speech.proto.SpeechRecognitionAlternative.transcript) -} -inline ::std::string* SpeechRecognitionAlternative::mutable_transcript() { - set_has_transcript(); - // @@protoc_insertion_point(field_mutable:cobalt.speech.proto.SpeechRecognitionAlternative.transcript) - return transcript_.MutableNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -inline ::std::string* SpeechRecognitionAlternative::release_transcript() { - // @@protoc_insertion_point(field_release:cobalt.speech.proto.SpeechRecognitionAlternative.transcript) - clear_has_transcript(); - return transcript_.ReleaseNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -inline void SpeechRecognitionAlternative::set_allocated_transcript( - ::std::string* transcript) { - if (transcript != NULL) { - set_has_transcript(); - } else { - clear_has_transcript(); - } - transcript_.SetAllocatedNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), transcript); - // @@protoc_insertion_point(field_set_allocated:cobalt.speech.proto.SpeechRecognitionAlternative.transcript) -} - -// optional float confidence = 2; -inline bool SpeechRecognitionAlternative::has_confidence() const { - return (_has_bits_[0] & 0x00000002u) != 0; -} -inline void SpeechRecognitionAlternative::set_has_confidence() { - _has_bits_[0] |= 0x00000002u; -} -inline void SpeechRecognitionAlternative::clear_has_confidence() { - _has_bits_[0] &= ~0x00000002u; -} -inline void SpeechRecognitionAlternative::clear_confidence() { - confidence_ = 0; - clear_has_confidence(); -} -inline float SpeechRecognitionAlternative::confidence() const { - // @@protoc_insertion_point(field_get:cobalt.speech.proto.SpeechRecognitionAlternative.confidence) - return confidence_; -} -inline void SpeechRecognitionAlternative::set_confidence(float value) { - set_has_confidence(); - confidence_ = value; - // @@protoc_insertion_point(field_set:cobalt.speech.proto.SpeechRecognitionAlternative.confidence) -} - -#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - - -// @@protoc_insertion_point(namespace_scope) - -} // namespace proto -} // namespace speech -} // namespace cobalt - -#ifndef SWIG -namespace google { -namespace protobuf { - -template <> -struct is_proto_enum< - ::cobalt::speech::proto::SpeechRecognitionEvent_StatusCode> - : ::google::protobuf::internal::true_type {}; -template <> -struct is_proto_enum< - ::cobalt::speech::proto::SpeechRecognitionEvent_EndpointerEventType> - : ::google::protobuf::internal::true_type {}; - -} // namespace protobuf -} // namespace google -#endif // SWIG - -// @@protoc_insertion_point(global_scope) - -#endif // PROTOBUF_google_5fstreaming_5fapi_2eproto__INCLUDED