Java Speech Development Kit: A Tutorial
Java Speech Markup Language (JSML) is a markup language derived from XML and is used to describe an audio entrance in the synthesizers of the API. Its elements are able to supply detailed information about how to pronounce the text provided to the synthesizer. These elements describe the structure of a document (paragraphs, phrases), the words pronounced, text markers and prosodic elements that control phrasing, emphasis, pitch, speaking rate and other important characteristics. Appropriate markup of text improves the quality and naturalness of the synthesized voice.
JSML is used as arguments to the synthesizers and can be accessed through one of the forms of the method speak. It might be provided in a text file with the JSML formatted text or in small phrases as arguments for the method. Table 4 shows the JSML tags:
Table 2. JSML Tags
Element | Description | Example |
PARA | Determines that the marked text must be pronounced as a paragraph. | <PARA>This is a short paragraph.</PARA> <PARA>The subject has changed, so this is a new paragraph.</PARA> |
SENT | Determines that the marked text must be pronounced as a phrase. | <PARA><SENT>So long.</SENT><SENT>See you later.</SENT></PARA> |
SAYAS | Specifies how the marked text must be read. | <SAYAS SUB="0x0">zero draw</SAYAS> |
EMP | Determines the emphasis of the pronounce. The values might be: "strong", "moderate", "none", or "reduced". | <EMP LEVEL="reduced">Whispering is not polite.</EMP> |
BREAK | Determines a stop during synthesis. Milliseconds or size can be used: "none", "small", "medium", or "large". | <BREAK MSECS="300"/> or <BREAK SIZE="small"/> |
PROS | Determines the speech properties: volume (VOL absolute number between 0.0 and 1.0), rhythm (RATE in words per minute), frequency (PITCH in hertz), frequency interval (RANGE in hertz). | <PROS RATE= "50" VOL="+80%">Í'll repeat loud and clear, just one more time. </PROS> |
MARKER | When this tag is reached a markerReached event is triggered, this might be interpreted by a SpeakableListener. A tag MARKER can be positioned anywhere in the JSML text, making it possible to monitor the whole text being pronounced. | Answer <MARKER MARK="yes_no"/> yes or no. |
ENGINE | Provides information to the synthesizer identified by the ENGID, that will pronounce what is defined by the DATA parameter. If the synthesizer is not available, the marked text will be pronounced instead. | The frog does <ENGINE ENGID= "Frog_Sint1.0" DATA="ribbit=1"> improper synthesizer</ENGINE> |
The recognizers are the entities responsible for speech recognition. They are created through the Central class and are initialized using the allocate method. They process the audio entering in parallel to the main application.
The recognition is done with the help of a set of words that limit the universe of possibilities that can be pronounced by the user. These sets are extensible, and new words can be added, increasing the application functionality. The sets are known as grammars, and it is necessary to have at least one grammar associated with each recognizer.
When audio enters the recognizers, they try to determine an association between the spoken words and their associated grammars. The recognition process culminates on the creation of objects named results. Results have types ACCEPTED or REJECTED accordingly to the confidence level determined by the setConfidenceLevel method (the default value is 0.5).
In the same way as the synthesizers, the recognizers are created through the Central class in two possible ways:
1. Accessing the recognizer's default implementation that better fits the current locale. It is the simplest manner and the most common:
Locale.setDefault("en","US");
Recognizer recognizer =
Central.createRocognizer(null);
2. Accessing a recognizer that satisfies predetermined conditions, this method is used in cases where there are more than one recognizer implementation available. The required parameters are:
name of the engine
name of the mode in which it will be used
a locale supported by the engine
a Boolean value, a control flag of the engine
a Boolean value, indicating whether the recognizer supports dictation grammar
an array of SpeakerProfile objects
Any of the parameters might be null, and the Central class will try to make the best choice for them. These parameters are defined via a RecognizerModeDesc object, as shown here:
RecognizerModeDesc(String engine, String mode, Locale locale, Boolean running, Boolean dictationGrammarSupported, SpeakerProfile[] profiles)
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Designing Electronics with Linux | May 22, 2013 |
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
- Designing Electronics with Linux
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Dynamic DNS—an Object Lesson in Problem Solving
- Using Salt Stack and Vagrant for Drupal Development
- Build a Skype Server for Your Home Phone System
- Why Python?
- New Products
- A Topic for Discussion - Open Source Feature-Richness?
- Validate an E-Mail Address with PHP, the Right Way
- Tech Tip: Really Simple HTTP Server with Python
- Understanding the Linux Kernel
1 hour 19 min ago - General
3 hours 49 min ago - Kernel Problem
13 hours 52 min ago - BASH script to log IPs on public web server
18 hours 19 min ago - DynDNS
21 hours 54 min ago - Reply to comment | Linux Journal
22 hours 27 min ago - All the articles you talked
1 day 50 min ago - All the articles you talked
1 day 54 min ago - All the articles you talked
1 day 55 min ago - myip
1 day 5 hours ago
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?



Comments
Reference Links are Dead
hi there
this is a very nice article. i really liked it and i planned to implement this in my project but unfortunately all the references links are dead.
kindly help me out . u can reach me at gobicse@gmail.com....
any help will be of great help..
thanks
Reference Links are Dead
hi there
this is a very nice article. i really liked it and i planned to implement this in my project but unfortunately all the references links are dead.
kindly help me out . u can reach me at gobicse@gmail.com....
any help will be of great help..
thanks
This is really useful. I
This is really useful. I successfully completed my project voice controlled wheel chair with the help of this concept... It works well....
Re: Java Speech Development Kit: A Tutorial
Is there lib to use text to speak in portuguese language ?
Re: Java Speech Development Kit: A Tutorial
i have read your tutorial about the Java Speech Development Kit, it is truely very interesting, i would realy love to develop a programe of my own on this context. please help me im a graduate from the University of Botswana in Computer Science in Botswana, i realy ineterested in speech program but i dont know where to start and what i need. more especialy that i dont have any of the classies that i can use for statup training plz give me an advice.
my Email is matikitim2@yahoo.cu.com
thank you in advace
Moathodi Excellent Matikiti
Re: Java Speech Development Kit: A Tutorial
I am in the same situation as Moathodi, were I would like to develope a program on this subject. I would really appreciate it if you could aid me in kicking it of as I am not sure were to start.
My email is adil_rehman@hotmail.com
Many Thanks
Adil
Speech recognition engines
I have done a lot of research on the speech development architecture of java..but i am more interested in some package that might make the development of a speech to text application faster. Thanx...hope i get a reply...my emaill is mario_ramotar@yahoo.com