/// <summary>Creates service definition that can be registered with a server</summary>
 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
 public static grpc::ServerServiceDefinition BindService(SpeechBase serviceImpl)
 {
     return(grpc::ServerServiceDefinition.CreateBuilder()
            .AddMethod(__Method_Recognize, serviceImpl.Recognize)
            .AddMethod(__Method_LongRunningRecognize, serviceImpl.LongRunningRecognize)
            .AddMethod(__Method_StreamingRecognize, serviceImpl.StreamingRecognize).Build());
 }
Exemplo n.º 2
0
 /// <summary>Creates service definition that can be registered with a server</summary>
 public static ServerServiceDefinition BindService(SpeechBase serviceImpl)
 {
     return(ServerServiceDefinition.CreateBuilder()
            .AddMethod(__Method_SyncRecognize, serviceImpl.SyncRecognize)
            .AddMethod(__Method_AsyncRecognize, serviceImpl.AsyncRecognize)
            .AddMethod(__Method_StreamingRecognize, serviceImpl.StreamingRecognize).Build());
 }
Exemplo n.º 3
0
 // Use this for initialization
 public SpeechOut()
 {
     if (Application.platform == RuntimePlatform.OSXEditor || Application.platform == RuntimePlatform.OSXPlayer)
     {
         speech = new MacOSSPeechOut();
     }
     else if (Application.platform == RuntimePlatform.WindowsEditor || Application.platform == RuntimePlatform.WindowsPlayer)
     {
         speech = new WindowsSpeechOut();
     }
     Init();
 }
 /// <summary>Register service method with a service binder with or without implementation. Useful when customizing the  service binding logic.
 /// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
 /// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
 public static void BindService(grpc::ServiceBinderBase serviceBinder, SpeechBase serviceImpl)
 {
     serviceBinder.AddMethod(__Method_Recognize, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Google.Cloud.Speech.V1P1Beta1.RecognizeRequest, global::Google.Cloud.Speech.V1P1Beta1.RecognizeResponse>(serviceImpl.Recognize));
     serviceBinder.AddMethod(__Method_LongRunningRecognize, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Google.Cloud.Speech.V1P1Beta1.LongRunningRecognizeRequest, global::Google.LongRunning.Operation>(serviceImpl.LongRunningRecognize));
     serviceBinder.AddMethod(__Method_StreamingRecognize, serviceImpl == null ? null : new grpc::DuplexStreamingServerMethod <global::Google.Cloud.Speech.V1P1Beta1.StreamingRecognizeRequest, global::Google.Cloud.Speech.V1P1Beta1.StreamingRecognizeResponse>(serviceImpl.StreamingRecognize));
 }