AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to get a list of all available voices?

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
chiragjain1989
Guest





PostPosted: Mon Jul 06, 2009 5:56 am    Post subject: How to get a list of all available voices? Reply with quote

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





PostPosted: Mon Jul 06, 2009 6:18 am    Post subject: Reply with quote

mod, please move to ask for help
Back to top
SKAN



Joined: 26 Dec 2005
Posts: 8688

PostPosted: Fri Jul 10, 2009 4:08 am    Post subject: Reply with quote

* Bump *
Back to top
View user's profile Send private message Send e-mail
smikkelsen



Joined: 24 Jun 2008
Posts: 104

PostPosted: Fri Jul 10, 2009 6:45 am    Post subject: Reply with quote

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
View user's profile Send private message
Sean



Joined: 12 Feb 2007
Posts: 2462

PostPosted: Fri Jul 10, 2009 7:15 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group