Microsoft 语音对象库 - 客户端还是服务器?

发布于 2024-11-06 15:45:09 字数 1765 浏览 5 评论 0原文

我知道您可以将 Microsoft Speech Object Library 用于 ASP.NET 站点。但这取决于客户端,还是来自服务器?我想知道客户端是否完全依赖于像 Mac 或 Linux 一样使用它?

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using SpeechLib;
using System.Threading;

namespace ARIES.Web.Controllers
{
    public class HomeController : Controller
    {
        public static SpVoice speach;

        public ActionResult Index()
        {
            ViewBag.Message = "Welcome to ASP.NET MVC!";

            speach = new SpVoice();
            //speach.Speak("This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test ", SpeechVoiceSpeakFlags.SVSFDefault);
            speach.Speak("This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test", SpeechVoiceSpeakFlags.SVSFlagsAsync);
            //speach.WaitUntilDone(Timeout.Infinite);

            return View();
        }

        public void Stop()
        {
            speach.Pause();
            speach = new SpVoice();
            speach.Speak("Stopped", SpeechVoiceSpeakFlags.SVSFlagsAsync);
        }
    }
}

I know you can use Microsoft Speech Object Library for asp.net sites. But does that depend on the client, or does it come from the server? I want to know if the client is dependent at all on using it like Macs or Linux?

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using SpeechLib;
using System.Threading;

namespace ARIES.Web.Controllers
{
    public class HomeController : Controller
    {
        public static SpVoice speach;

        public ActionResult Index()
        {
            ViewBag.Message = "Welcome to ASP.NET MVC!";

            speach = new SpVoice();
            //speach.Speak("This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test ", SpeechVoiceSpeakFlags.SVSFDefault);
            speach.Speak("This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test", SpeechVoiceSpeakFlags.SVSFlagsAsync);
            //speach.WaitUntilDone(Timeout.Infinite);

            return View();
        }

        public void Stop()
        {
            speach.Pause();
            speach = new SpVoice();
            speach.Speak("Stopped", SpeechVoiceSpeakFlags.SVSFlagsAsync);
        }
    }
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

单身狗的梦 2024-11-13 15:45:09

您是在服务器端代码中使用该对象还是通过客户端上的 javascript 使用该对象?

如果您仅在服务器上使用它,那么它不需要存在于客户端计算机上,但声音将在服务器上播放,而不是客户端上。

如果您通过 javascript 使用它,则客户端需要它,并且您也可能仅限于 Internet Explorer。

Are you using the object in your server side code or through javascript on the client?

If you are only using it on the server then it doesn't need to exist on the client machines but the sound will play on the server, not the client.

If you are using it through javascript it is required on the clients and you are also probably restricted to internet explorer only.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文