如何在ASP.NET中启用语音识别 [英] How to enable speech recognization in ASP.NET

查看:208
本文介绍了如何在ASP.NET中启用语音识别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在asp.net中启用语音而不是短信。



是否有用于语音识别的API?



请帮助..



我尝试过:



How to enable speech instead of text messages in asp.net.

Is there any API for speech recognization ??

Please help..

What I have tried:

using System.Speech;
using System.Speech.Synthesis;

  private void btnSubmit_Click(object sender, RoutedEventArgs e)
        {
            SpeechSynthesizer synthesizer = new SpeechSynthesizer();
            synthesizer.Volume = 100;  // 0...100
            synthesizer.Rate = 0;     // -10...10

            // Synchronous
            synthesizer.Speak(txtSpeech.Text );

            // Asynchronous
           // synthesizer.SpeakAsync("Welcome to the WPF Tutorial.");
        }

推荐答案

您不能使用System.Speech类。 ASP.NET代码完全在服务器上运行,从不在客户端运行。



您需要一个在客户端工作的库。 Google用于javascript语音识别并开始阅读。
You cannot use the System.Speech classes. ASP.NET code runs entirely on the server, never on the client.

You need a library that works on the client side. Google for "javascript speech recognition" and start reading.


Javascript语音合成API具有合理的浏览器支持:我可以使用...语音合成API [ ^ ]



IE11和Android浏览器是主要的保留,似乎有 Chrome实施中的一个错误 [ ^ ]在15秒后停止播放。



谈话的网络应用程序 - 语音合成API简介  ; | 网络  |  Google开发者 [ ^ ]



注意:这是演讲综合 - 电脑跟你说话 - 不是言语识别 - 你在和电脑说话。有一个语音识别API,但几乎没有支持:我可以使用...语音识别API [< a href =https://caniuse.com/#feat=speech-recognitiontarget =_ blanktitle =New Window> ^ ]
The Javascript speech synthesis API has reasonable browser support: Can I use... Speech Synthesis API[^]

IE11 and Android browser are the main hold-outs, and there seems to be a bug in the Chrome implementation[^] which stops playback after 15 seconds.

Web apps that talk - Introduction to the Speech Synthesis API  |  Web  |  Google Developers[^]

NB: This is speech synthesis - the computer talking to you - NOT speech recognition - you talking to the computer. There is a speech recognition API, but it has virtually no support: Can I use... Speech Recognition API[^]


这篇关于如何在ASP.NET中启用语音识别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆