Sample bookmark listener from tts Azure documentation not working
See original GitHub issueHi,
In a java application, I try to use bookmarks for evaluating audio offsets in a text-to-speech conversion and even the sample code from the tts documentation is giving false results.
Any idea on what is the problem in my coding or a limitation that applies ?
Here is the code :
private void test() {
String speechSubscriptionKey = "38blabla";
String serviceRegion = "westeurope";
config = SpeechConfig.fromSubscription(speechSubscriptionKey, serviceRegion);
assert (config != null);
config.setSpeechSynthesisOutputFormat(SpeechSynthesisOutputFormat.Audio24Khz96KBitRateMonoMp3);
String ssml = "<speak version=\"1.0\" xmlns=\"http://www.w3.org/2001/10/synthesis\" xml:lang=\"en-US\">\r\n"
+ " <voice name=\"en-US-AriaNeural\">\r\n"
+ " We are selling <bookmark mark='flower_1'/>roses and <bookmark mark='flower_2'/>daisies.\r\n"
+ " </voice>\r\n" + "</speak>\r\n" + "";
assert (ssml != null);
SpeechSynthesizer synth;
synth = new SpeechSynthesizer(config, null);
assert (synth != null);
synth.BookmarkReached.addEventListener((o, e) -> {
// The unit of e.AudioOffset is tick (1 tick = 100 nanoseconds), divide by
// 10,000 to convert to milliseconds.
System.out.println(
"Bookmark " + e.getText() + " reached. Audio offset: " + e.getAudioOffset() / 10000 + "ms.");
});
// creates voice
SpeechSynthesisResult result = synth.SpeakSsml(ssml);
assert (result != null);
And here is the result :
Bookmark flower_1 reached. Audio offset: 50ms.
Bookmark flower_2 reached. Audio offset: 50ms.
Which is not the expected result.
My configuration for this test : Windows 10 with java jdk 1.8.0_301.
Issue Analytics
- State:
- Created 2 years ago
- Comments:16 (8 by maintainers)
Top Results From Across the Web
Azure Text to speech SSML bookmark tags Error
The bookmark element is incompatible with the prosody and break elements. You can't adjust pause and prosody like pitch, contour, rate, ...
Read more >How to synthesize speech from text - Azure
See the text to speech overview for more information about: ... To trigger a bookmark reached event, a bookmark element is required in...
Read more >What's new in Azure AI Speech?
Fix authentication token not working when getting speech synthesis voice ... Added VisemeReceived event for TTS/speech synthesis to return ...
Read more >TTS Rest Endpoint for SSML bookmark tag - Microsoft Q&A
I read that Microsoft evaluates the bookmark element within SSML text. According to the documentation, this can be subscribed to with one of ......
Read more >Speech Synthesis Markup Language (SSML) overview
You can wrap text with event tags such as bookmark or viseme that can be processed ... Although the SSML document itself is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just synced with service guy, the ETA to fix this issue is end of Nov. Thanks!
I am also experiencing this bug from .NET.