473,409 Members | 2,056 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,409 software developers and data experts.

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="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

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

<SCRIPT LANGUAGE="JavaScript">

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

function ChangeVoice() {
var i = parseInt( idsVoices.value );
VoiceObj.Voice = VoiceObj.GetVoices().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
SpeechVoiceSpeakFlags
// enumerated type.
function SpeakText() {
if( idbSpeakText.text == "Leggi" )
{
// Speak the string in the edit box
try
{
VoiceObj.Speak( idTextBox.text, 1 );
}
catch(exception)
{
alert("Speak error");
}
}
else if( idbSpeakText.text == "Stop" )
{
// Speak empty string to Stop current speaking. The value "2" for
// the second parameter corresponds to the SVSFPurgeBeforeSpeak
// value in the SpeechVoiceSpeakFlags enumerated type.
VoiceObj.Speak( "", 2 );
}
}

</SCRIPT>

<SCRIPT FOR="window" EVENT="OnQuit()" LANGUAGE="JavaScript">
// 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><%=Paragraph %></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="return 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="JavaScript">
// Code in the BODY of the webpage is used to initialize controls and
// to handle SAPI events

/***** Initializer code *****/
InitializeControls();

function InitializeControls()
{
// Initialize the Voices Select boxes
var VoicesToken = VoiceObj.GetVoices();

// Add correct strings to Voice Select box
for( var i=0; i<VoicesToken.Count; i++ )
{
var oOption = document.createElement("OPTION");
idsVoices.options.add(oOption);
oOption.innerText = VoicesToken.Item(i).GetDescription();
oOption.value = i;
}

}

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

// Handle StartStream event
function VoiceObj::StartStream() {
idbSpeakText.text = "Stop";
}

// Handle EndStream event
function VoiceObj::EndStream() {
idbSpeakText.text = "Leggi";

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

Mar 23 '06 #1
0 989

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

Similar topics

4
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...
5
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...
16
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...
1
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...
0
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...
0
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...
3
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...
2
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...
6
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...
7
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.