| View previous topic :: View next topic |
| Author |
Message |
chiragjain1989 Guest
|
Posted: Mon Jul 06, 2009 5:56 am Post subject: How to get a list of all available voices? |
|
|
Hi,
I am using pywin32com.client for Text to speech in Windows Vista. The default voice is Microsoft Anna.
Now I install espeak for windows and now I get three more voices. These voices are displayed in the Control Panel--> Text to Speech.
I am writing a python application. I want to know is there any function of pywin32.com.client.Dispatch() which can return me a list of all the currently installed voices in the computer which I can display in a combo box in my application. Although the user can always go to the control panel to change the default voice, but I want him to select it from my application only without going to the control panel.
Thanks and regards
Chirag
[ Moderator!: Moved from Scripts and Functions ] |
|
| Back to top |
|
 |
wrong section alert Guest
|
Posted: Mon Jul 06, 2009 6:18 am Post subject: |
|
|
| mod, please move to ask for help |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 8688
|
Posted: Fri Jul 10, 2009 4:08 am Post subject: |
|
|
| * Bump * |
|
| Back to top |
|
 |
smikkelsen
Joined: 24 Jun 2008 Posts: 104
|
Posted: Fri Jul 10, 2009 6:45 am Post subject: |
|
|
I know this seems like an obvious question, but have you checked the python documentation, or tried a python forum?
http://python-forum.org/pythonforum/index.php _________________ “Whenever I'm about to do something, I think, 'Would an idiot do that?' And if they would, I do not do that thing.”
-Dwight |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 2462
|
Posted: Fri Jul 10, 2009 7:15 am Post subject: |
|
|
| Code: | COM_Init()
pvoice := COM_CreateObject("SAPI.SpVoice")
pvoices := COM_Invoke(pvoice, "GetVoices")
Loop, % COM_Invoke(pvoices, "Count")
sVoices .= COM_Invoke(pvoices, "Item[" A_Index-1 "].GetDescription") "`n"
COM_Release(pvoices)
COM_Release(pvoice)
COM_Term()
MsgBox % sVoices
|
|
|
| Back to top |
|
 |
|