Click here to Skip to main content
15,666,183 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I want


to be something like:


And then a language is returned as a string maybe, as I want to categorize dozens of voices that the user may have into categories based on their language, I want

To return:
"English - United States"
"Arabic-Saudi Arabia"

So what should I use instead of "Language"?

And what if I want to know if it's a voice of a male or a female?

What I have tried:

SpObjectTokenCategory otc = new SpObjectTokenCategory();


            ISpeechObjectTokens tokenEnum = otc.EnumerateTokens();


            foreach (SpeechLib.ISpeechObjectToken v in tokenEnum)
                string s = v.GetDescription();// thid doesn't always return the language sometimes only the name of the voice
                string a = v.GetAttribute(/*what here?*/);
Updated 21-Aug-21 3:04am
Gerry Schmitz 21-Aug-21 13:04pm    
Get the default (speech) voice. Voice properties include gender, etc.
john1990_1 21-Aug-21 13:12pm    
Thx but this is for:
System.Speech.Synthesis speechsynthesizer
Not for
Speechlib SpVoice

I would have to change all of my program, is there an easier way for me?
Gerry Schmitz 22-Aug-21 12:16pm    
Same thing. Yours is the "assembler" version.

You started out difficult; and continue with difficult.
john1990_1 22-Aug-21 12:41pm    
You mean it's better that I switch to:
"System.Speech.Synthesis speechsynthesizer"
instead of:
"Speechlib SpVoice",
Will I have to change a lot in my program or it's basically the same code?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900