Android Question Providing text-to-speech with phonetic input

Andrew Gray

Member
Licensed User
Longtime User
Is there any way of giving the text to speech engine phonetic input, rather than input in a particular language? I'm creating an app for African users who are not fully literate, and it would be useful to have TTS in exotic languages that are not supported by Android but for which I can provide phonetic spellings. (I realise these wouldn't sound perfect, but the result would be intelligible.)

I've read that the Android TTS engine accepts input in Speech Synthesis Markup Language (SSML). However, when I try, for example:

B4X:
TTSEngine.Speak ("<phoneme alphabet=\""xsampa\"" ph=\""[ljonse ulutSe:lo akasuBa kale:ma\""/>.",True)

...which I'd hoped would read out "ljonse ulutSe:lo akasuBa kale:ma" (a sentence in the African language Bemba spelled phonetically), it simply reads out the tags as if they were part of the text.

Is there any way of giving the TTS engine phonetic input?
 

Andrew Gray

Member
Licensed User
Longtime User
Thanks. I can't get the example on that page to work in B4A though.

It gives the example:

B4X:
String text = "<speak xml:lang=\"en-US\"> <phoneme alphabet=\"xsampa\" ph=\"d_ZIn\"/>.</speak>";
mTts.speak(text, TextToSpeech.QUEUE_ADD, null);

However, when I put the equivalent into B4A:

B4X:
    TTSEngine.Speak ("<speak xml:lang=\""en-US\""> <phoneme alphabet=\""xsampa\"" ph=\""d_ZIn\""/>.</speak>", True)

...the result is silence.

(The TTS engine is correctly initialised; it works fine with ordinary English input.)

Am I doing something wrong?
 
Upvote 0
Top