Hi Louie,

louie wrote:
> I am looking for a text to speech program that has a mark up
> langwitch. I want to embed commands for voice, rate, etc.
>


There's an existing mark up language for controlling atributes for  
Apple's text to speech.  The easy way to do this is to use Automator,  
which allows you to select the voice in the "Text to Audio" action of  
the workflow.  However, you'll find a link to the document that gives  
instructions on how to embed commands for all the speech attributes in  
a forwarded reply from Apple's accessibility team that Jane posted to  
the list a little over a year ago.  Here's the archived post (in case  
you want to read down the thread with the Control-n access key for  
Safari; to get to the earlier thread that prompted that post, use  
Control-b twice to go back chronologically, then you'll be able to  
read a post that describes working with text-to-speech in Automator.   
You can press Control-p three times to go up through previous posts in  
the thread and start from the beginning of the thread, then use  
Control-n to read down the discussion).  I'll excerpt the relevant bit  
of the post:

http://www.mail-archive.com/[email protected]/msg24218.html
(Fwd: Adjusting Say Speech in Terminal)

<begin excerpt>

 Check out this site for information on how to embed commands into the  
text to speed it up or change other attributes:

http://developer.apple.com/documentation/UserExperience/Conceptual/SpeechSynthesisProgrammingGuide/index.html

Embedded commands are described in the section titled "Techniques for  
Customizing Synthesized Speech" - > "Use Embedded Speech Commands to  
Fine-Tune Spoken Output.
For example, to set the rate of the spoken text to 300 words per  
minute use something like:
"[[rate 300]] This text should be spoken fast."
<end quote>

The above specification of speech rate within two sets of embedded  
brackets is the way that Darcy got faster text-to-speech working in  
his Screenless Switchers podcast.  It's also the basis of a post that  
Doug Lee made to the list on how to speed up Skype VoiceOver  
notifications:

http://www.mail-archive.com/[email protected]/msg40196.html

For a concrete example of how this would work with Automator, I'm  
pasting in below a reply I made to a related post on Gordon Smith's  
mac-access list (for more info on this, see: 
http://www.tft-bbs.com/mailing-lists.html 
  and to subscribe, send an email to: [email protected] )

Hope this helps.

Cheers,

Esther

On Feb 10, 2009 GK wrote:
> Some way back I thought I recalled mention of a script that could be  
> used to take a text file and using the speech save it as an mp3 file.
>
> I would be very grateful if somebody could point me to the u.r.l.  
> where said script can be downloaded.

I have notes about this somewhere, but in the meantime, here are two  
alternatives:

• Apple has a demo Automator workflow that converts text from your  
clipboard to an audio clip in iTunes. You could download this and  
modify it to work with a selected TextEdit file instead of the  
clipboard, and you could change the setting from AAC encoding to mp3.   
The Apple URL is:

http://automator.us/leopard/examples/ex07/index.html

and you can get the workflow from the page's download link.  It's  
actually easier to check the components out under Automator. It's made  
up of 4 steps:

1. Get Contents from Clipboard
2. Text to Audio File
3. Import Audio Files
4. Add Songs to Playlist

You can hear these listed if you VO-right to the Workflow area of  
Automator, interact, and VO-down arrow through the list once you've  
downloaded it.

To run this as is, download the workflow and open it.  Select some  
text and copy to clipboard with Command-C.  Then do a Command-R to run  
the workflow.  As it stands, the workflow creates an AAC file called  
"Spoken Text" that it move into your iTunes library.  You can change  
the format to MP3 by interacting with the "Import Audio Files" action  
of the Workflow and VO-right to the popup button that specifies using  
the "AAC encoder" and setting this to "MP3 encoder".

There's a trick to getting text to speech to record this at a faster  
rate -- put the following characters at the beginning of the file:

[[rate 300]]

That's two left brackets (where left bracket is the key to the right  
of the "p" key), the word "rate", a space, and a number which is the  
words per minute, then two right brackets.  In the example used above,  
the rate is 300 words per minute.

What you really want to do is replace the "Get Contents from  
Clipboard" action with "Get Contents of TextEdit Document", but this  
is a little more complicated, since actions get added to the end of  
the workflow.  You'd have to first select the new action by
1. Navigating (VO-right) to the Actions Library, and selecting  
"Text" (press "t")
2. Navigate (VO-right) to the Actions table and select "Get Contents  
of TextEdit Document" (press "g")
3. Add this to the work flow (Interact with VO-Shift-Down arrow,  
Double-Click with VO-Shift-Space, stop interacting with VO-Shift-Up  
arrow).

At this point the new action has been added to the end of the  
workflow, as you'll find if you VO-right to the Workflow area and  
interact. Moving actions up or down to reorder them in the workflow  
requires that you move your mouse cursor to the header of each action  
and Control-click. You'll get menu options to move up or down, or to  
disable or enable actions.  So after double-clicking to add "Get  
Contents of TextEdit Document" to the Workflow, you would

4. VO-right to the Workflow area, interact, navigate with arrow keys  
to the "Get Contents of TextEdit Document" action and interact to move  
to its header.  Then, if you don't have your mouse cursor tracking  
your VoiceOver cursor you would have to move it to your VO cursor with  
Command-Option-F5 so that you could Control-click (press the control  
key and click your trackpad or mouse key) to bring up the menu with  
option to move up.  You'd move this action to the top of the workflow  
and either delete or disable the "Get Contents from Clipboard" action.

You can also save this as a plugin, so you can run this from a context  
menu (e.g., select a text file and use VO-Shift-M to select the  
automator action).  I haven't been working with Automator for some  
time, so maybe someone else could pick up this thread.  There's  
probably a way to add a small file that contains your speed  
preferences as a merger to the workflow.

Anyway, the advantage of pointing you to the Apple URL is that it will  
immediately work.

• Second option is to try:

http://www.spokentext.net

You can upload or paste in a selection of text, specify a rate in  
words per minute, and have them convert this into an mp3 file for  
you.  The voice isn't Alex, but it's fairly speedy.

HTH

Cheers,

Esther
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MacVisionaries" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/macvisionaries?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to