Lexicon is ignored in SSML using MS cognitive speech service

Andreas Lange 41 Reputation points
2021-08-31T09:16:05.81+00:00

I try to use a lexicon but the TTS service ignores it.

This is my lexicon xml file:

<lexicon xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://www.w3.org/2005/01/pronunciation-lexicon http://www.w3.org/TR/2007/CR-pronunciation-lexicon-20071212/pls.xsd" 
    version="1.0" 
    xml:lang="de-DE"
    xmlns="http://www.w3.org/2005/01/pronunciation-lexicon">
    <lexeme>
        <grapheme>Achsöl</grapheme>
        <phoneme>aks øːl</phoneme>
    </lexeme>
</lexicon>

I serve the file using a simple python server and ngrok

python3 -m http.server 80
ngrok http 80
In my c# code I create SSML which looks like this when sent to the TTS service:

<speak version="1.0"
       xmlns="http://www.w3.org/2001/10/synthesis"
       xmlns:mstts="http://www.w3.org/2001/mstts"    
       xmlns:emo="http://www.w3.org/2009/10/emotionml"
       xml:lang="de-DE">
    <voice name="Microsoft Server Speech Text to Speech Voice (de-DE, KatjaNeural)">
        <lexicon uri="https://xyz.ngrok.io/Lexikon.xml" />
        Achsöl
    </voice>
</speak>

But the TTS service ignores my lexicon. I've checked that the file is accessible from internet.

What am I doing wrong?

Azure AI Speech
Azure AI Speech
An Azure service that integrates speech processing into apps and services.
1,405 questions
{count} votes

Accepted answer
  1. romungi-MSFT 42,286 Reputation points Microsoft Employee
    2021-09-03T13:14:29.897+00:00

    @Andreas Lange I think in the above lexicon file alphabet="ipa" is missing. I am able to validate this by adding this tag and uploading the same to speech studio with KatjaNeural voice in german. Also, please ensure no space is used for syllable boundary in IPA pronunciation. It's invalid. Use . as syllable boundary.

    <?xml version="1.0" encoding="utf-8"?>  
    <lexicon xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   
         xsi:schemaLocation="http://www.w3.org/2005/01/pronunciation-lexicon http://www.w3.org/TR/2007/CR-pronunciation-lexicon-20071212/pls.xsd"   
         version="1.0"   
         xml:lang="de-DE"  
         xmlns="http://www.w3.org/2005/01/pronunciation-lexicon"  
         alphabet="ipa">  
         <lexeme>  
             <grapheme>Achsöl</grapheme>  
             <phoneme>aks.øːl</phoneme>  
         </lexeme>  
     </lexicon>  
    

    I hope this helps.


0 additional answers

Sort by: Most helpful