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
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>
Determines that the marked text must be pronounced as a phrase.
<PARA><SENT>So long.</SENT><SENT>See you later.</SENT></PARA>
Specifies how the marked text must be read.
<SAYAS SUB="0x0">zero draw</SAYAS>
Determines the emphasis of the pronounce. The values might be: "strong", "moderate", "none", or "reduced".
<EMP LEVEL="reduced">Whispering is not polite.</EMP>
Determines a stop during synthesis. Milliseconds or size can be used: "none", "small", "medium", or "large".
<BREAK MSECS="300"/> or <BREAK SIZE="small"/>
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>
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.
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)
Practical Task Scheduling Deployment
One of the best things about the UNIX environment (aside from being stable and efficient) is the vast array of software tools available to help you do your job. Traditionally, a UNIX tool does only one thing, but does that one thing very well. For example, grep is very easy to use and can search vast amounts of data quickly. The find tool can find a particular file or files based on all kinds of criteria. It's pretty easy to string these tools together to build even more powerful tools, such as a tool that finds all of the .log files in the /home directory and searches each one for a particular entry. This erector-set mentality allows UNIX system administrators to seem to always have the right tool for the job.
Cron traditionally has been considered another such a tool for job scheduling, but is it enough? This webinar considers that very question. The first part builds on a previous Geek Guide, Beyond Cron, and briefly describes how to know when it might be time to consider upgrading your job scheduling infrastructure. The second part presents an actual planning and implementation framework.
Join Linux Journal's Mike Diehl and Pat Cameron of Help Systems.
Free to Linux Journal readers.View Now!
|The Firebird Project's Firebird Relational Database||Jul 29, 2016|
|Stunnel Security for Oracle||Jul 28, 2016|
|SUSE LLC's SUSE Manager||Jul 21, 2016|
|My +1 Sword of Productivity||Jul 20, 2016|
|Non-Linux FOSS: Caffeine!||Jul 19, 2016|
|Murat Yener and Onur Dundar's Expert Android Studio (Wrox)||Jul 18, 2016|
- Stunnel Security for Oracle
- The Firebird Project's Firebird Relational Database
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- SUSE LLC's SUSE Manager
- Managing Linux Using Puppet
- My +1 Sword of Productivity
- Non-Linux FOSS: Caffeine!
- SuperTuxKart 0.9.2 Released
- Google's SwiftShader Released
- Doing for User Space What We Did for Kernel Space
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide