macspeech module?

savageb savageb at pacbell.net
Thu Oct 14 16:23:15 EDT 1999


Ben Jones wrote:
----------------
> Where can I find the Speech Channel objects for the Macspeech Module?
> They didn't come with the download
> I would really like to use them. GetPitch etc

Ben,

Speech Channel Objects are created from individual voices that need to be
loaded in the Voices folder of the Extensions folder in the System Folder.

The Voices come with the Operating System. If they are not already
installed, you can either do a custom install from the install CD or
download them from Apple's website.

There is a way to test if you have the basic components installed in Python:

>>> import macspeech
>>> macspeech.Available()

this should return 1
if so, try this:

>>> macspeech.CountVoices()

on my computer this returns 22

To get a Speech Channel Object you first select one of the voices by number,
so I could select a number from 1 to 22 (*Not* 0 - 21). As it turns out the
numbering system is the opposite of the alphabetic listing of the voices (I
don't know why), so if you did:

>>> import os
>>> l = os.listdir("HD:System Folder:Extensions:Voices")
>>> l.reverse()
>>> v = macspeech.GetIndVoice( l.index('Ralph') + 1)

(where 'HD' was the name of your Hard Drive containing the active OS) you
would have a Voice *FROM WHICH* you create the Speech Channel Object:

>>> sco = v.NewChannel()

This is the object that you can manipulate by setting the pitch etc.

Good luck with it!

Bob Savage




More information about the Python-list mailing list