Friday, 29 July 2011

Speech Synthesis:


javax.speech.synthesis 
 
·         A speech synthesizer is a speech engine that converts text to speech. The javax.speech.synthesispackage defines the Synthesizer interface to support speech synthesis plus a set of supporting classes and interfaces.
"Hello World!"
The following code shows a simple use of speech synthesis to speak the string "Hello World".


import javax.speech.*;
import javax.speech.synthesis.*;
import java.util.Locale;

public class HelloWorld {
   public static void main(String args[]) {
           try {
                   // Create a synthesizer for English
                   Synthesizer synth = Central.createSynthesizer(
                          new SynthesizerModeDesc(Locale.ENGLISH));

                   // Get it ready to speak
                   synth.allocate();
                   synth.resume();

                   // Speak the "Hello world" string
                   synth.speakPlainText("Hello, world!", null);

                   // Wait till speaking is done
                   synth.waitEngineState(Synthesizer.QUEUE_EMPTY);

                   // Clean up
                   synth.deallocate();
           } catch (Exception e) {
                   e.printStackTrace();
           }
   }
}


This example illustrates the four basic steps which all speech synthesis applications must perform. Let's examine each step in detail.
·         Create: The Central class of javax.speech package is used to obtain a speech synthesizer by calling the createSynthesizer method. The SynthesizerModeDesc argument provides the information needed to locate an appropriate synthesizer. In this example a synthesizer that speaks English is requested.
·         Allocate and Resume: The allocate and resume methods prepare the Synthesizer to produce speech by allocating all required resources and putting it in the RESUMED state.
·         Generate: The speakPlainText method requests the generation of synthesized speech from a string.
·         Deallocate: The waitEngineState method blocks the caller until the Synthesizer is in theQUEUE_EMPTY state - until it has finished speaking the text. The deallocate method frees the synthesizer's resources.

Requirements



To use the Java Speech API, a user must have certain minimum software and hardware available. The following is a broad sample of requirements. The individual requirements of speech synthesizers and speech recognizers can vary greatly and users should check product requirements closely.
·         Speech software: A JSAPI-compliant speech recognizer or synthesizer is required.
·         System requirements: most desktop speech recognizers and some speech synthesizers require relatively powerful computers to run effectively. Check the minimum and recommended requirements for CPU, memory and disk space when purchasing a speech product.
·         Audio Hardware: Speech synthesizers require audio output. Speech recognizers require audio input. Most desktop and laptop computers now sold have satisfactory audio support. Most dictation systems perform better with good quality sound cards.
·         Microphone: Desktop speech recognition systems get audio input through a microphone. Some recognizers, especially dictation systems, are sensitive to the microphone and most recognition products recommend particular microphones. Headset microphones usually provide best performance, especially in noisy environments. Table-top microphones can be used in some environments for some applications.

Applications of Speech Technology



1.     Desktop
Speech technology can augment traditional graphical user interfaces. At its simplest, it can be used to provide audible prompts with spoken "Yes/No/OK" responses that do not distract the user's focus. But increasingly, complex commands are enabling rapid access to features that have traditionally been buried in sub-menus and dialogs. For example, the command "Use 12-point, bold, Helvetica font" replaces multiple menu selections and mouse clicks.
2.     Telephony Systems
Speech technology is being used by many enterprises to handle customer calls and internal requests for access to information, resources and services.
Universal messaging systems can provide a single point of access to multiple media such as voice-mail, email, fax and pager messages. Such systems rely upon speech synthesis to read out messages over the telephone. For example: "Do I have any email?" "Yes, you have 7 messages including 2 high priority messages from the production manager." "Please read me the mail from the production manager." "Email arrived at 12:30pm...".
3.     Personal and Embedded Devices
Speech technology is being integrated into a range of small-scale and embedded computing devices to enhance their usability and reduce their size. Such devices include Personal Digital Assistants (PDAs), telephone handsets, toys and consumer product controllers.
4.     Speech and the Internet
The Java Speech API allows applets transmitted over the Internet or intranets to access speech capabilities on the user's machine. This provides the ability to enhance World Wide Web sites with speech and support new ways of browsing. Speech recognition can be used to control browsers, fill out forms, control applets and enhance the WWW/Internet experience in many other ways. Speech synthesis can be used to bring web pages alive, inform users of the progress of applets, and dramatically improve browsing time by reducing the amount of audio sent across the Internet.

Design Goals for the Java Speech API



Along with the other Java Media APIs, the Java Speech API lets developers incorporate advanced user interfaces into Java applications. The design goals for the Java Speech API included:
·         Provide support for speech synthesizers and for both command-and-control and dictation speech recognizers.
·         Provide a robust cross-platform, cross-vendor interface to speech synthesis and speech recognition.
·         Enable access to state-of-the-art speech technology.
·         Support integration with other capabilities of the Java platform, including the suite of Java Media APIs.
·         Be simple, compact and easy to learn.

Java Speech API



     With the Java Speech API you can incorporate speech technology into user interfaces for your applets and applications based on Java technology. This API specifies a cross-platform interface to support command and control recognizers, dictation systems and speech synthesizers.


Cross-Industry Development 

     The Java Speech API was developed by Sun Microsystems, Inc. in collaboration with leading speech technology companies: Apple Computer, Inc., AT&T, Dragon Systems, Inc., IBM Corporation, Novell, Inc., Philips Speech Processing, and Texas Instruments Incorporated. Sun works with third-party speech companies to encourage the availability of multiple implementations.

What is the Java Speech API?

     The Java Speech API defines a standard, easy-to-use, cross-platform software interface to state-of-the-art speech technology. Two core speech technologies are supported through the Java Speech API: speech recognition and speech synthesis. Speech recognition provides computers with the ability to listen to spoken language and to determine what has been said. In other words, it processes audio input containing speech by converting it to text. Speech synthesis provides the reverse process of producing synthetic speech from text generated by an application, an applet or a user. It is often referred to as text-to-speech technology.

Wednesday, 20 July 2011

What is JavaScript?


  • JavaScript was designed to add interactivity to HTML pages
  • JavaScript is a scripting language
  • A scripting language is a lightweight programming language
  • JavaScript is usually embedded directly into HTML pages
  • JavaScript is an interpreted language (means that scripts execute without preliminary compilation)
  • Everyone can use JavaScript without purchasing a license

Tuesday, 19 July 2011

Window Object

<html>
<head>
<script type="text/javascript">
function show_alert()
{
alert("Chetan n Sultana Welcomes U!!!!");
}
</script>
</head>
<body>
<input type="button" onclick="show_alert()" value="Show alert box" />
</body>
</html>