Last reviewed: 3/23/2024 10:35:52 AM

Generating Markup

The VoiceMarkupKit management class is designed to provide a lot of flexiblity and minimize the programming necessary to generate text-to-speech markup.

NVoiceMarkupKit _VoiceMarkupKit = new NVoiceMarkupKit();
_VoiceMarkupKit.SetCredentials("Credentials");
NW3CSSMLVoiceMarkup _W3CSSMLVoiceMarkup = _VoiceMarkupKit.CreateW3CVoiceMarkup();
string markup = _W3CSSMLVoiceMarkup.GenerateMarkup("Rate", "5", "This text is spoken above the baseline at rate of five");
CVoiceMarkupKit* _VoiceMarkupKit = new CVoiceMarkupKit();
_VoiceMarkupKit->SetCredentials(L"Credentials");
CW3CSSMLVoiceMarkup* _W3CSSMLVoiceMarkup = _VoiceMarkupKit->CreateW3CSSMLVoiceMarkup();
wchar_t* markup = _W3CSSMLVoiceMarkup->GenerateMarkup(L"Rate", L"5", L"This text is spoken above the baseline at rate of five");
CVoiceMarkupKit* _VoiceMarkupKit = new CVoiceMarkupKit();
_VoiceMarkupKit->SetCredentials("Credentials");
CW3CSSMLVoiceMarkup* _W3CSSMLVoiceMarkup = _VoiceMarkupKit->CreateW3CSSMLVoiceMarkup();
string markup = _W3CSSMLVoiceMarkup->GenerateMarkup("Rate", "5", "This text is spoken above the baseline at rate of five");
var 
    _VoiceMarkupKit: TVoiceMarkupKit;
    _W3CSSMLVoiceMarkup: TW3CSSMLVoiceMarkup;
    markup: string; 
begin        
    _VoiceMarkupKit := TVoiceMarkupKit.Create();  
    _VoiceMarkupKit.SetCredentials('Credentials');  
    _W3CSSMLVoiceMarkup := _VoiceMarkupKit.CreateW3CSSMLVoiceMarkup();   
    markup = _W3CSSMLVoiceMarkup.GenerateMarkup('Rate', '5', 'This text is spoken above the baseline at rate of five');
JVoiceMarkupKit _VoiceMarkupKit = new JVoiceMarkupKit();
_VoiceMarkupKit.setCredentials("Credentials");
JW3CSSMLVoiceMarkup _W3CSSMLVoiceMarkup = _VoiceMarkupKit.createW3CSSMLVoiceMarkup();
String markup = _W3CSSMLVoiceMarkup.generateMarkup("Rate", "5", "This text is spoken above the baseline at rate of five");
Dim _VoiceMarkupKit As NVoiceMarkupKit = Nothing
Dim _W3CSSMLVoiceMarkup As NW3CSSMLVoiceMarkup = Nothing
Dim markup as String
_VoiceMarkupKit = New NVoiceMarkupKit()
_VoiceMarkupKit.SetCredentials("Credentials")
_W3CSSMLVoiceMarkup = _VoiceMarkupKit.CreateW3CVoiceMarkup()
markup = _W3CSSMLVoiceMarkup.GenerateMarkup("Rate", "5", "This text is spoken above the baseline at rate of five")

A common tag may be generated with voice-specific markup. Some common tags have unique attributes. Some tags are unique to a syntax. The following table provides a tag list for generation to serve as an index for markup quick references by syntax.

Markup TagAttribute(s)Encloses TextMarkup Syntax
alternatevalueYes Acapela
audiosourceYesAzure, W3C
audiovaluesYesAcapela
audioboostvalueYesAcapela
audiodurationvalueNoAzure
backgroundaudiosrc, volume, fadein, fadeoutNoAzure
bookmarkmarkNoAcapela, Azure, SAPI5, W3C
colibrivalueYesAcapela
commentYesAzure, SAPI5, W3C
contextaliasYesSAPI5, W3C
deemphasislevelYesAcapela, Azure, W3C
emphasislevelYesAcapela, Azure, SAPI5, W3C
equalizerpresetYesAcapela
express-asstyle, styledegreeYesAzure
groupofvalueYesAcapela
languagelangYesAzure, SAPI5, W3C
lexiconsourceNoCereVoice, W3C
muteableYesAcapela
partofspeechpartYesAcapela, SAPI5
pausemodemodesYesAcapela
pitchinc/decYesAcapela, Azure, CereVoice, SAPI5, W3C
pitchrangecontourYesAzure, W3C
pronunciationalphabet, phYesAzure, SAPI5, W3C
pronunciationphonemesYesAcapela, CereVoice
rateinc/decYesAcapela, Azure, CereVoice, SAPI5, W3C
relativepitchinc/decYesAcapela, Azure, SAPI5, W3C
relativepitchrangecontourYesAzure, W3C
relativespeedinc/decYesAcapela
resetYesAcapela
silenceamountNoAcapela, SAPI5, W3C
silencetype, valueNoAzure
silencetype, timeNoCereVoice
skipvalueYesAcapela
spellYesAcapela, Azure, SAPI5, W3C
spurtgesureidYesCereVoice
uselvariantYesCereVoice
visemetypeNoAzure
voicegender, variantYesSAPI5, W3C
voicevaluesYesAcapela
voicegestureidYesCereVoice
voiceshapingvalueYesAcapela
volumeinc/decYesAcapela, Azure, CereVoice, SAPI5, W3C
warpvalueYesAcapela