473,663 Members | 2,877 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

speech application

This is a aspx (2005) page. It should make my PC to speak, but it
does't work. Can anybody help me to make it work? Please!
<%@ Page Language="VB" AutoEventWireup ="false" CodeFile="Leggi .aspx.vb"
Inherits="_Defa ult" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Leggi Libro</title>

<SCRIPT LANGUAGE="JavaS cript">

// Create the Sapi SpVoice object
var VoiceObj = new ActiveXObject(" Sapi.SpVoice");

function ChangeVoice() {
var i = parseInt( idsVoices.value );
VoiceObj.Voice = VoiceObj.GetVoi ces().Item(i);
}

function IncRate() {
alert("Sono in incrate");
if( VoiceObj.Rate < 10 )
{
VoiceObj.Rate = VoiceObj.Rate + 1;
}
}

function DecRate() {
if( VoiceObj.Rate > -10 )
{
VoiceObj.Rate = VoiceObj.Rate - 1;
}
}

function IncVol() {
if( VoiceObj.Volume < 100 )
{
VoiceObj.Volume = VoiceObj.Volume + 10;
}
}

function DecVol() {
if( VoiceObj.Volume > 9 )
{
VoiceObj.Volume = VoiceObj.Volume - 10;
}
}

// SpeakText() function:
// This function gets the text from the textbox and sends it to the
// Voice object's Speak() function. The value "1" for the second
// parameter corresponds to the SVSFlagsAsync value in the
SpeechVoiceSpea kFlags
// enumerated type.
function SpeakText() {
if( idbSpeakText.te xt == "Leggi" )
{
// Speak the string in the edit box
try
{
VoiceObj.Speak( idTextBox.text, 1 );
}
catch(exception )
{
alert("Speak error");
}
}
else if( idbSpeakText.te xt == "Stop" )
{
// Speak empty string to Stop current speaking. The value "2" for
// the second parameter corresponds to the SVSFPurgeBefore Speak
// value in the SpeechVoiceSpea kFlags enumerated type.
VoiceObj.Speak( "", 2 );
}
}

</SCRIPT>

<SCRIPT FOR="window" EVENT="OnQuit() " LANGUAGE="JavaS cript">
// Clean up voice object
delete VoiceObj;
</SCRIPT>

</head>
<body>
<form name="form1">
<div>
<center><font size= "5" face="Verdana"> BOOK READER<br
/></font></center>
<br />
<P align="center">
<TEXTAREA name=TEXTAREA1 COLS=50 ROWS=10><%=Para graph %></TEXTAREA>
</P>
<P align="center">
Velocità
<INPUT id=idbIncRate name=button1 type=button onclick="return
IncRate();" value=" + ">
<INPUT id=idbDecRate name=button2 type=button onclick="return
DecRate();" value=" - " style="LEFT: 237px; TOP: 292px">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;&nbsp;

Volume
<INPUT id=idbIncVol name=button3 onclick="return IncVol();"
style="LEFT: 67px; TOP: 318px" type=button value=" + ">
<INPUT id=idbDecVol name=button4 onclick="return DecVol();" type=button
value=" - " style="LEFT: 134px; TOP: 377px">
</P>
<br />
<P align="center">
<INPUT id=idbSpeakText onclick="return SpeakText();" value= "Leggi"
style=" LEFT: 363px; TOP: 332px; height: 24px;" type=button size="" >
</P>
<br />
<P align="center">
Voce
<SELECT id=idsVoices name=Voices onchange="retur n ChangeVoice();"
style="FONT-FAMILY: serif; HEIGHT: 21px; WIDTH: 179px"> </SELECT>
&nbsp; &nbsp;&nbsp;

Paragrafo
<asp:Button ID="indietro" runat="server" Height="24px" Text="
<< " Width="60px" />
<asp:Button ID="avanti" runat="server" Height="24px" Text=">>
" Width="60px" />
</P>
<br />
<P align="center">
<asp:Button ID="esci" runat="server" Height="24px" Text="Esci"
Width="80px" />
<br />
</P>
</div>
</form>
<SCRIPT LANGUAGE="JavaS cript">
// Code in the BODY of the webpage is used to initialize controls and
// to handle SAPI events

/***** Initializer code *****/
InitializeContr ols();

function InitializeContr ols()
{
// Initialize the Voices Select boxes
var VoicesToken = VoiceObj.GetVoi ces();

// Add correct strings to Voice Select box
for( var i=0; i<VoicesToken.C ount; i++ )
{
var oOption = document.create Element("OPTION ");
idsVoices.optio ns.add(oOption) ;
oOption.innerTe xt = VoicesToken.Ite m(i).GetDescrip tion();
oOption.value = i;
}

}

/***** Event handling code *****/
// These functions are used to handle the SAPI events

// Handle StartStream event
function VoiceObj::Start Stream() {
idbSpeakText.te xt = "Stop";
}

// Handle EndStream event
function VoiceObj::EndSt ream() {
idbSpeakText.te xt = "Leggi";

</SCRIPT>
</body>
</html>

Mar 23 '06 #1
0 998

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1886
by: BrewskiAtBellSouth | last post by:
Is it my imagination or is the stuff in the SASDK overly complex? For example, let's say I'd like to have a one page web application where I enter a name into a text box and have the application read the name back to me when I click a button on the page ("Hello World" for SASDK). Seems like the prompt control would be ideal for this ... except that the <InlineContent> tag is ReadOnly. ReadOnly?!? Am I expected to build a grammar dynamically...
5
2205
by: Rod | last post by:
About two weeks ago I had an accident and have broken my left elbow and left wrist. For doing things like Word or e-mail (I use Outlook for) I have been using Microsoft's speech recognition and that has been working fine. However as a professional programmer I need to be able to type. Right now I can't do that (until my arm heals). I've heard of a program by ScanSoft called Dragon NaturallySpeaking Professional. I called ScanSoft and...
16
7531
by: ShadowOfTheBeast | last post by:
Hi all, is there any one who have developed an application in c# using a text-speech engine using the Microsoft Speech SDK 5.1 especially using visual studio.net IDE 2003 (v7.1) I seem to get an inter-op compiling error and cant seem to resolve it! help! -- The Matrix Insurrection
1
1754
by: Sateesh Kumar E C | last post by:
Dear all, I have developed a voice-enabled web application on Win2003 using SASDK Beta 3 using VisualStudio.NET. In order to access this web application the browser must add the speech plug-in component. Some of the users who are accessing this voice-enabled web application doesn't have a speech plug-in installed in their machine, somehow I have to identify whether the speech plug-in is installed in their system or not by using Javascript and...
0
1428
by: Sateesh Kumar E C | last post by:
Dear all, I have developed a speech web application using Speech SDK(SASDK) with VisualStudio.NET on Win2003 environment. Users can access this speech web application by using SALT enabled browser i.e. the browser must have installed with Speech plug-in. some of the users access this speech web application without having the Speech plug-in installed in their system. In that case I have to give the option to the user to run the setup...
0
1254
by: Sateesh Kumar E C | last post by:
Dear all, I have developed a voice-enabled(SALT) web application on Win2003 using SASDK Beta 3 using VisualStudio.NET. During speech recognition i.e. when the Listen element starts(user sees the audio meter on the UI) the speech recognition engine interprets even noise also and the application reacts to this noise. Is ther any possiblity of avoiding interpretion of noise by speech recognition engine so that the application doesn't react...
3
1116
by: krishna murthy | last post by:
Hi, I have one doubt i have dragon speech recognisations system in my application there is button called evaluation when i press this button my application should open a predefined word templet and what ever i speek the text should be attached to a particluar field in predefined templet.is it possible ?please give me solutions Regards,
2
4162
by: Onur | last post by:
Hi.All I'm working on a TTS application. It runs on my local pc (WindowXP pro) without any error. Microsoft Visual Studio .NET 2003, Microsoft .NET Framework SDK v1.1, Microsoft Speech Application SDK 1.1. are installed on my local pc. My web server is Windows 2003 server Enterprise. Microsoft .NET Framework Version:1.1 and Microsoft Speech Server 2004 are installed on the server.
6
3437
by: rolf.oltmans | last post by:
Hello, I am working on an web-based application where users will give their input in form of speech using microphone and I've to show whatever they spoke in text in a textbox, how is that possible? Just give me any pointers on this. I will really appreciate any help on this. Best Regards,
7
1757
by: HardySpicer | last post by:
I am writing my own recogniser and synthesis software in VB .net. However, every time I get the syntheser to speek something the mic picks it up and thinks it is a command! It is quite bizzar - it sits there talking to itself pure jibberish! I use Microsoft Speech the latest SDK. I tried turing off teh recogniser of course but it doesn't seem to work. If I turn down the volume of the speakers it's ok of course but I want to hear the...
0
8436
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8345
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8858
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8771
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8548
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8634
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6186
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
2763
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1757
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.