Last reviewed: 3/23/2024 10:13:51 AM

Lexicons

A lexicon is a collection of words and information about these words used by a text-to-speech to enhance its the quality of its pronunciation.

Text-to-speech voices can use application lexicons as a reference for the pronunciation information about words specific to an application. You may deploy lexicons with your application.

To set Cepstral lexicon on the voice, use the SetProperty method.


// Not supported

// Create synthesizer
_Synthesizer = _SpeechKit.CreateSwiftSynthesizer();
if (_Synthesizer != null)
{
    _Synthesizer.SetProperty("lexicon", "path\\mylexicon.txt");
}

// Create synthesizer
_Synthesizer = _SpeechKit->CreateSwiftSynthesizer();
if (_Synthesizer != NULL)
{
    _Synthesizer->SetProperty(L"lexicon", L"path\\mylexicon.txt");
}
    

// Create synthesizer
_Synthesizer = _SpeechKit->CreateSwiftSynthesizer();
if (_Synthesizer != NULL)
{
    _Synthesizer->SetProperty("lexicon", "path\\mylexicon.txt");
}

// Create synthesizer
_Synthesizer := _SpeechKit.CreateSwiftSynthesizer();
if (_Synthesizer <> nil) then
begin
    _Synthesizer.SetProperty('lexicon', 'path\\mylexicon.txt');
end;
    

// Create synthesizer
_Synthesizer = _SpeechKit.createSwiftSynthesizer();
if (_Synthesizer != null)
{
    _Synthesizer.setProperty("lexicon", "path\\mylexicon.txt");
}

// Not supported

// Not supported

_Synthesizer = _SpeechKit.CreateSwiftSynthesizer()
if (_Synthesizer IsNot Nothing) Then
    _SpeechKit.SetProperty("lexicon", "path\mylexicon.txt")
End If