Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Android TTS support Speech Synthesis Markup Language?

Passing the following SSML (Speech Synthesis Markup Language) document to the com.svox.pico TextToSpeech engine resulted in a reading of the XML body but no control from the phoneme element or the emphasis element. This result (no apparent SSML control) is the same on a Nexus One running Android 2.2 as well as on the emulator running an AVD with SDK level 8.

            String text = "<?xml version=\"1.0\"?>" +
                "<speak version=\"1.0\" xmlns=\"http://www.w3.org/2001/10/synthesis\" " +
                    "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " +
                    "xsi:schemaLocation=\"http://www.w3.org/2001/10/synthesis " +
                        "http://www.w3.org/TR/speech-synthesis/synthesis.xsd\" " +
                    "xml:lang=\"en-US\">" +

                    "tomato " +
                    "<phoneme alphabet=\"ipa\" ph=\"t&amp;#x259;mei&amp;#x325;&amp;#x27E;ou&amp;#x325;\"> tomato </phoneme> " +

                    "That is a big car! " +
                    "That <emphasis> is </emphasis> a big car! " +
                    "That is a <emphasis> big </emphasis> car! " +
                    "That is a huge bank account! " +
                    "That <emphasis level=\"strong\"> is </emphasis> a huge bank account! " +
                    "That is a <emphasis level=\"strong\"> huge </emphasis> bank account!" +
                "</speak>";
            mTts.speak(text, TextToSpeech.QUEUE_ADD, null);

Does any Android TTS engine support any of the SSML elements?

like image 634
gregS Avatar asked Aug 19 '10 19:08

gregS


People also ask

What is Android TTS features?

Android allows you convert your text into voice. Not only you can convert it but it also allows you to speak text in variety of different languages. This method adds a mapping between a string of text and a sound file.

What is AddSpeech () method in Android?

AddSpeech(String, String, Int32) Adds a mapping between a string of text and a sound resource in a package. AddSpeech(ICharSequence, String, Int32) Adds a mapping between a CharSequence (may be spanned with TtsSpans) of text and a sound resource in a package.

What Speech Synthesis Markup Language Ssml element should you use?

The speak element is the root element. It's required for all SSML documents. The speak element contains important information, such as version, language, and the markup vocabulary definition.


1 Answers

I've been experimenting with SSML and it seems that the TTS engine wraps its input automaticly with the root <speak> element, so if you leave it out, then it works fine and you don't get a parser error.

Example:

String text = "Testing <phoneme alphabet=\"xsampa\" ph=\"&#34;{k.t@`\"/>.";
mTts.speak(text, TextToSpeech.QUEUE_ADD, null);
like image 127
RoToRa Avatar answered Oct 03 '22 05:10

RoToRa