I implemented this Java program to work with TTS using Polly: http://docs.aws.amazon.com/polly/latest/dg/examples-java.html
I use a Dutch male voice that is good and natural, but I find it too fast. I see in Polly docs that voice speed can be controlled using something similar in SSML, as shown on this page:
http://docs.aws.amazon.com/polly/latest/dg/ssml-synthesize-speech- cli.html
aws polly synthesize-speech \
--text-type ssml \
--text '<speak><prosody rate="x-slow">Hello world</prosody></speak>' \
--output-format mp3 \
--voice-id Joanna \
speech.mp3
But how can I incorporate this into my Java? I tried this (with formatting for Windows):
text = "\<speak><prosody rate='x-slow'>" + text + "</prosody></speak> ^";
PollyDemo helloWorld = new PollyDemo(Region.getRegion(Regions.US_EAST_1));
InputStream speechStream = helloWorld.synthesize(text, OutputFormat.Mp3);
But I feel for in the dark. Can anyone help? Thank.
source
share