revSpeech related question

Sarah Reichelt sarah.reichelt at gmail.com
Mon Feb 5 21:58:05 EST 2007


On 2/6/07, Trevor Hopkins <tjhopkins224 at hotmail.com> wrote:
> I have an application that I would like to parse into a menu, all of the
> voices that are currently installed on a user's Mac. The user can then
> select one of these voices from the menu and have Rev set the voice, check
> the selected menuItem, and then uncheck all other voices in the menu.
>

Here is what I use:

I am assuming that you have a "Voices" menu in your menubar.
The currently selected voice is stored in a custom property called
cCurrentVoice.

Put this script into the menubar group's script:

-- list all the voices and add a checkmark to the currently selected one
--
on mouseDown
    put revSpeechVoices() into tVoiceList
    put the cCurrentVoice of this stack into tCurrent
    get lineOffset(tCurrent, tVoiceList)
    if it > 0 then put "!c" before line it of tVoiceList
    put tVoiceList into btn "Voices"
end mouseDown


Put this script into the "Voices" menu script:

-- store the new selection in the custom property
-- set Rev's voice
-- speak a sample of text
--
on menuPick pVoice
    set the cCurrentVoice of this stack to pVoice
    revSetSpeechVoice pVoice
    revSpeak "Do you like this voice?"
end menuPick

HTH,
Sarah



More information about the use-livecode mailing list