На главную Наши проекты:
Журнал   ·   Discuz!ML   ·   Wiki   ·   DRKB   ·   Помощь проекту
ПРАВИЛА FAQ Помощь Участники Календарь Избранное RSS
msm.ru
Модераторы: RaD, nsh
  
> Как реализовать на c# распознавание речи отт Яндекса(SpeechKit Cloud) , распознавание речи отт Яндекса(SpeechKit Cloud)
    Есть ли примеры кода на c# распознавания речи от Яндекс?
      Цитата ivan_007 @

      Вот все что нашел на другом форуме
      public string PostMethod(byte[] bytes)
      {
      string postUrl = "https://asr.yandex.net/asr_xml?" +
      "uuid=01ee33cb744628b58fb536d496daa1e6&" +
      "key="+_apiKey+"&" +
      "topic=queries";

      HttpWebRequest request = (HttpWebRequest)WebRequest.Create(postUrl);
      request.Method = "POST";
      request.Host = "asr.yandex.net";
      request.SendChunked = true;
      request.UserAgent = "Oleg";

      request.ContentType = "audio/x-pcm;bit=16;rate=16000";
      request.ContentLength = bytes.Length;

      using (var newStream = request.GetRequestStream())
      {
      newStream.Write(bytes, 0, bytes.Length);
      }

      HttpWebResponse response = (HttpWebResponse)request.GetResponse();
      string responseToString = "";
      if (response != null)
      {
      var strreader = new StreamReader(response.GetResponseStream(), Encoding.UTF8);
      responseToString = strreader.ReadToEnd();
      }

      int index = responseToString.IndexOf("<variant confidence=\"1\">");

      responseToString = responseToString.Substring(index + 24, responseToString.Length - index - 24);

      int index2 = responseToString.IndexOf("</variant>");

      responseToString = responseToString.Substring(0, index2);

      return responseToString;
      }
      0 пользователей читают эту тему (0 гостей и 0 скрытых пользователей)
      0 пользователей:


      Рейтинг@Mail.ru
      [ Script execution time: 0,0141 ]   [ 16 queries used ]   [ Generated: 18.04.24, 10:34 GMT ]