I have two methods, setSpeechRate(Float value)
and public int synthesizeToFile(final CharSequence text, final Bundle params, final File file, final String utteranceId)
, and I am hoping to find a way to synthesize those files within a different speech rate.
Therefore, the first step is to call to setSpeechRate(4.0f)
(which returns 0
or SUCCESS
). Nevertheless, when I synthesize the String
into a file within the same Text-to-Engine
, and I play it using MediaPlayer
, I can not play it faster than the default value speechRate = 1
.
I was hoping that, since the speechRate
is actually updated to 4.0
, the resulting file would also have the same rate. What am I missing?
According to docs, setSPeechRate has no effect on "pre-recorded speech." Its a strange and confusing choice of words, but I'm assuming that by "pre-recorded," they mean speech created using synthesizeToFile.
It makes sense because slower speech would result in large files, and it would be difficult to play the same file at various speeds.
So it looks like you have to use the player to control speech rate.