Jelly Bean Google Voice text-to-speech API?

2019-02-18 11:25发布

问题:

Is there a way I can use the text-to-speech from the new Google Voice? In Jelly Bean the pronunciation is really smooth so I was thinking may be there is some kind of API for access to that service?

Thanks!

回答1:

Yes, it is possible to access the Google Now voice using the Android TTS APIs. You need to use "KEY_FEATURE_NETWORK_SYNTHESIS" in the "params" parameter for the TextToSpeech.speak() call.

See

http://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine.html#KEY_FEATURE_NETWORK_SYNTHESIS

and

http://developer.android.com/reference/android/speech/tts/TextToSpeech.html#speak(java.lang.String,int,java.util.HashMap)



回答2:

Have you tried to use just the standard TextToSpeech class?

See Reference for usage. You can pass a "engine" string to the constructor. If the JB TTS Engine appears as a different engine you could choose it there. But I assume that the new JB TTS engine is used automatically if you just select the standard TTS engine.