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

时间:2011-05-10 21:53:00

标签: asp.net text-to-speech

我知道您可以将asp语音对象库用于asp.net网站。但这取决于客户端,还是来自服务器?我想知道客户端是否完全依赖它来使用Macs或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);
        }
    }
}

1 个答案:

答案 0 :(得分:1)

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

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

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