更改Android的文本到语音的默认语音 [英] Changing the default voice of Android's Text To Speech

查看:135
本文介绍了更改Android的文本到语音的默认语音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了Android的文本到语音在我的应用程序默认引擎,但是女性的声音听起来像一个女人过了40,她的声音有点机器人。

我看到似乎使用内置TTS谷歌的其他应用程序,但它听起来好了很多,也就是年轻女子与一个更自然的声音。

这是自然的声音也正在在Android主谷歌搜索,例如使用当你preSS的麦克风,并问一个问题(Siri的风格),如谁是美国的president,女人的声音会告诉你答案。

怎么可以这样的声音在code ++实现的?

基本上这就是我做我的code:

  TextToSpeech TTS =新TextToSpeech(这一点,这一点);
          。
          。
          。
    tts.setLanguage(Locale.US);
    tts.speak(文字,TextToSpeech.QUEUE_FLUSH,NULL);
 

解决方案

我最终设法找到一个解决方案。我只需要使用KEY_FEATURE_NETWORK_SYNTHESIS参数它可以在软糖。默认脱机模式具有可怕的机器人的声音

I'm using the Android's Text To Speech default engine in my app, however the female's voice sounds like a woman over 40 and her voice is somewhat robotic.

I saw other apps that seems to use Google's built in TTS, but it sounds a lot better i.e young woman with a more natural voice.

That "natural" voice is also being used in the Android main Google Search e.g. when you press on the mic and ask a question (Siri style) like "who is the president of the US", the woman's voice will tell you the answer.

How can this voice be achieved in the code?

Basically this is what I do in my code:

    TextToSpeech tts = new TextToSpeech(this, this);
          .
          .
          .
    tts.setLanguage(Locale.US);
    tts.speak(text, TextToSpeech.QUEUE_FLUSH, null);

解决方案

I've eventually managed to find a solution. I just needed to use the KEY_FEATURE_NETWORK_SYNTHESIS param which is available on jellybean. The default offline mode has the awful robotic sound

这篇关于更改Android的文本到语音的默认语音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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