Beispiel #1
0
            public VoiceKitClient(string apiKey, string secretKey)

            {
                // _authSTT = GenerateToken(secretKey, apiKey);
                _authSTT = new Auth(apiKey, secretKey, "tinkoff.cloud.stt");



                GrpcChannelOptions gco = new GrpcChannelOptions();



                //var cred = new SslCredentials();


                gco.Credentials = new SslCredentials();


                // var channelSTT = new Channel("stt.tinkoff.ru:443", cred);


                var channelSTT = GrpcChannel.ForAddress("https://stt.tinkoff.ru:443", gco);

                // var channelSTT = new Grpc.Core.Channel("stt.tinkoff.ru:443", cred);

                _clientSTT = new SpeechToText.SpeechToTextClient(channelSTT);
            }
        public VoiceKitClient(string apiKey, string secretKey)
        {
            _authSTT = new Auth(apiKey, secretKey, "tinkoff.cloud.stt");
            _authTTS = new Auth(apiKey, secretKey, "tinkoff.cloud.tts");

            var cred       = new SslCredentials();
            var channelSTT = new Channel("api.tinkoff.ai:443", cred);
            var channelTTS = new Channel("api.tinkoff.ai:443", cred);

            _clientSTT = new SpeechToText.SpeechToTextClient(channelSTT);
            _clientTTS = new TextToSpeech.TextToSpeechClient(channelTTS);
        }