A Tutorial Introduction to SALT6. Speech Synthesis Mark-Up LanguageControl of how a SALT <PROMPT> object converts text to speech can be performed using the Speech Synthesis Mark-up Language (SSML). SSML is an XML-based markup language that can be used to control voice, pitch, rate, volume, pronunciation, and other characteristics of the output speech. We give a basic introduction to SSML below, but full details can be found in the W3C Speech Synthesis Markup Language Specification Version 1.0 or in the SASDK documentation. 6.1 Test applicationYou can use the following application to test SSML. Try this out on your computer: Normal version, Debug version.
<html xmlns:salt="http://www.saltforum.org/2002/SALT">
<object id="speech-add-in" CLASSID="clsid:33cbfc53-a7de-491a-90f3-0e782a7e347a">
</object>
<?import namespace="salt" implementation="#speech-add-in"/>
<salt:prompt id="prompter" xmlns="http://www.w3.org/2001/10/synthesis">
</salt:prompt>
<body>
<h2>SALT: Test SSML</h2>
<textarea id="iptext" rows=5 cols=50>
Type some <emphasis>marked-up</emphasis> text here.
</textarea><br>
<input type="button" name="speak" value="Speak" onClick="dospeak()">
</body>
<script>
function dospeak()
{
var pfield=document.getElementById("iptext");
var pprompt=document.getElementById("prompter");
pprompt.Start("<speak>"+pfield.value+"</speak>");
}
</script>
</html>
6.2 SSML Elements
<say-as> elementThe <say-as> element can be used to mark up text that needs to be produced in a particular way. The attribute "type=" can be set to any of these values:
Here are some examples (which you can cut and paste into the test application): The year is <say-as type="date">1930</say-as>. The total is <say-as type="currency">$20.45</say-as>. <phoneme> elementThe <phoneme> element can be used to provide a pronunciation for a piece of text. For the Microsoft Speech add-in, the phonetic transcription has to be in the Microsoft SAPI Phonetic Alphabet format. To indicate this you must include the "alphabet=sapi" attribute. The text enclosed in the tags is not pronounced but may be used to comment what was said. Here is an example: The British pronunciation of "grass" is <phoneme alphabet="sapi" ph="g r aa s">grass</phoneme>. <prosody> element
Here is an example: <speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="en-US"> <sentence> Your order for <prosody pitch="+0.5st" rate="-10%"> <say-as type="number"> 8 </say-as> books </prosody> will be shipped tomorrow. </sentence> </speak> Next: The <LISTEN> element in detail..
|
|
University College London - Gower Street - London - WC1E 6BT - |