开发者

Microsoft Speech Object Library - Client or server?

开发者 https://www.devze.com 2023-03-04 19:07 出处:网络
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 li

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 t开发者_JAVA技巧est 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);
        }
    }
}


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号