From 5249624a59375a2876b0f777f5db112d18cb3cc8 Mon Sep 17 00:00:00 2001 From: will wade Date: Tue, 18 Aug 2026 09:27:04 +0000 Subject: [PATCH] =?UTF-8?q?fix(azure):=20emit=20=20instead=20of?= =?UTF-8?q?=20W3C=20=20=E2=80=94=20Azure=20silently=20synthesises=20?= =?UTF-8?q?no=20audio=20for=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Azure's Speech service does not support the SSML element: an utterance containing one completes normally but synthesises zero audio, with no error from the service (verified live against the Azure-family Edge endpoint). Azure's documented equivalent is , delivered as a Bookmark synthesis event. The MicrosoftAzure formatter now maps [mark: "x"] to . Other platforms are unchanged. --- src/formatters/ssml/microsoft_azure.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/formatters/ssml/microsoft_azure.rs b/src/formatters/ssml/microsoft_azure.rs index 0d60f16..219e88a 100644 --- a/src/formatters/ssml/microsoft_azure.rs +++ b/src/formatters/ssml/microsoft_azure.rs @@ -215,6 +215,15 @@ impl MicrosoftAzureSsmlFormatter { match node.node_type { NodeType::PlainText => Ok(node.text.clone()), NodeType::TextModifier => self.format_azure_text_modifier(node), + // Azure's Speech service does not support the W3C SSML + // element: an utterance containing one synthesises zero audio, + // with no error from the service. Its documented equivalent is + // (fired as a Bookmark event instead of a + // named position). + NodeType::Mark => Ok(format!( + "", + self.base.escape_xml(&node.text) + )), _ => self.base.format_node_internal(node), } } @@ -447,6 +456,23 @@ mod tests { assert!(result.is_ok()); } + #[test] + fn test_microsoft_azure_mark_emits_bookmark() { + // Azure has no W3C (it silently synthesises zero audio); + // the documented equivalent is . + let input = "A [mark: \"b1\"] in the text."; + let result = + SpeechMarkdownParser::to_ssml(input, crate::formatters::base::Platform::MicrosoftAzure); + assert!(result.is_ok()); + + let ssml = result.unwrap(); + assert!(ssml.contains(""), "got: {ssml}"); + assert!( + !ssml.contains("