Android TTS(Text-To-Speech)不能正确发音单个字母 [英] Android TTS (Text-To-Speech) doesn't pronounce single letter correctly

查看:99
本文介绍了Android TTS(Text-To-Speech)不能正确发音单个字母的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Activity中实现Android的文本到语音技术.这是一个简单的文字游戏,我希望TTS引擎在用户按下某个按钮时拼出一个字母.例如,当用户按下 A 按钮时,我想听到"A".

I am trying to implement text to speech technology of Android in my Activity. It is a simple word game and I want the TTS engine to spell a single letter when the user presses some button. For example when the user presses the A button I want to hear "A".

问题是 .speak 方法仅将String作为输入.因此,当我告诉TTS引擎我只想要一个字母字符串时,声音不是字母的发音.有什么方法可以使单个字母字符串正确发音吗?

The problem is the the .speak method only takes a String as input. So, when I tell the TTS engine that I just want a single letter string, the sound is not the pronunciationof the letter. Is there any way that I can make it pronounce correctly the single letter strings?

到目前为止,解决方案是将听起来像字母的单词用作字符串输入,例如 B 为"bee", C 为"see",依此类推.但是 F H 等等呢?

The solution so far, was to use as string input, words that sound like the letters, e.g. "bee" for B, "see" for C and so on. But what about F, H and so on?

还有其他想法吗?

推荐答案

尝试了很多之后,我发现了一个更好的解决方案.为了使android tts引擎宣告单个字母,您必须将其写成大写.例如"B".这样,它会正确发音!唯一的例外是必须分别写为"ay"和"zet"的"A"和"Z"!

After experimenting a lot, I found a better solution. In order the android tts engine to anounce a single letter you have to write it in capitals. For example "B". This way it will pronounce correctly! The only exceptions are "A" and "Z" which have to be writen as "ay" and "zet"!

希望这对您有帮助

这篇关于Android TTS(Text-To-Speech)不能正确发音单个字母的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆