Hi Chris and Keith, Chris, that was a clever use of sed and regular expressions to prepend the rate argument to the beginning of the text being piped to the say command. Keith, if you want to play around more with the other embedded commands for speech, you'll find them in the Apple Developer Connection documentation. The site is: <http://developer.apple.com/documentation/UserExperience/Conceptual/SpeechSynthesisProgrammingGuide/index.html>
(That's all one line.) Embedded commands are described in the section titled "Techniques for Customizing Synthesized Speech" - > "Use Embedded Speech Commands to Fine-Tune Spoken Output. There are a whole lot of 4 character embedded commands besides the rate command that Chris used, and they're all enclosed in a double set of brackets. Here are some: char speaks the following word letter by letter cmnt lets you insert a comment that isn't spoken ctxt identifies a context for speech synthesizer pronunciation (I've never tried this) dlim lets you change the delimiter characters used for embedded speech commands emph lets you increase or decrease emphasis of the next word (takes an argument of "+" or "-") inpt lets you change the pronunciation model from straight text to options like phonetic (takes an argument) nmbr lets you speak numbers digit by digit if you use the LTRL argument instead of NORM pbas changes current speech pitch (takes an argument with "+" or "-") pmod changes pitch modulation range (takes an argument with "+' or "-") rate sets the speaking rate; can be used either with a value or by increasing or decreasing (with "+" or "-") rset resets speech parameters to default values (may need to be "rset 0") slnc lets you add a period of silence (takes an argument) volm lets you set or increase/decrease volume (takes an argument) There are a few more sequences described in the document for fancier functions. HTH. Cheers, Esther On Sep 12, 2011, at 11:00, Chris Blouch wrote: > Just tried is on Snow Leopard and got an error on the -r argument so it must > be new to Lion. For non-lion users I managed to prepending the rate command > to the text using sed which worked fine: > > curl -s > http://www.wunderground.com/cgi-bin/findweather/getForecast?query=33617 | > grep -A 2 tempActual | textutil -convert txt -stdin -stdout -format html | > sed "s/^/[[rate 900]]/" | say > > CB > > On 9/11/11 5:43 PM, Keith Watson wrote: >> >> Ester, >> >> I did not know that the rate switch was not available in earlier versions of >> OSX. I actually found it by…wait for it…RTFMing. <Grin>. Doing a man >> on say gave me all that info. The value for the rate is in words per minute >> according to the man page. Quite frankly I think they are full of it because >> I set it to 1000 and was able to understand every word. Maybe Alex tops out >> at around 600 or so. >> >> Anyway, having fun playing around with all this myself. Now if only I could >> get Tessa to cook me a nice dinner I would be in heaven. >> >> Keith >> >> On Sep 11, 2011, at 1:19 PM, Esther wrote: >> >>> Hi Keith, >>> >>> I'll just add that if you want the say command in your AppleScript to >>> announce the temperature in another voice, you can also set that as an >>> argument and use any of your installed system voices (including the InfoVox >>> voices if you have them). For example, if you're a French user in Snow >>> Leopard with the InfoVox French voice you could change the last part of >>> that shell script to a pipe to "say -v Alice", for example, or other valid >>> voice on your system. It looks as though there's an extra argument to the >>> "say" command in Lion that is not in Snow Leopard. Does the "r" switch >>> allow you to specify a speech rate? (That's not something you can do in >>> earlier versions of Mac OS X.) >>> >>> Cheers, >>> >>> Esther >>> >>> On Sep 11, 2011, at 05:27, Keith Watson wrote: >>> >>>> All, >>>> >>>> Like Scott said, this was an exercise in learning Apple Script and to >>>> facilitate the request of another list member. They did not want all the >>>> information that the weather widget gave. All they wanted was the outside >>>> temperature. If the weather widget works for you then by all means >>>> continue to use it and ignore this thread. I could really give a crap if >>>> you like or dislike the way myself or others wish to garner our >>>> information. >>>> >>>> So with that said, I have found that there is a way to do this with curl. >>>> Open your Apple Script editor and copy the following line into it. With >>>> this code you do not have to install Xcode or Mac Ports. And in the >>>> interest of full disclosure, I am also going to post the original Mac >>>> Hints snippet in case anyone is interested in whether or not it's going to >>>> be hotter today than yesterday. Oh and as before, make sure you >>>> substitute 33617 with your own zip code. >>>> >>>> *** Code starts on next line *** >>>> do shell script "curl -s >>>> http://www.wunderground.com/cgi-bin/findweather/getForecast?query=33617 | >>>> grep -A 2 tempActual | textutil -convert txt -stdin -stdout -format html | >>>> say -r 400" >>>> *** Code ends here *** >>>> >>>> Original Mac Hints code, with a pipe to say added by me. >>>> >>>> *** Code starts on next line. *** >>>> do shell script "curl -s >>>> http://www.wunderground.com/cgi-bin/findweather/getForecast?query=33617 | >>>> awk '/Today is/ || /Tomorrow is/' | textutil -convert txt -stdin -stdout >>>> -format html | say -r 400" >>>> *** Code ends here. *** >>>> >>>> >>>> If you have any problems or suggestions, please don;t hesitate to ask or >>>> criticize. I personally find that this method is slower than the other >>>> way, but it does not require any additional installs. >>>> >>>> Have fun. >>>> >>>> Keith >>>> On Sep 11, 2011, at 8:20 AM, Scott Howell wrote: >>>> >>>>> Donna, you are making the assumption that someone would always have that >>>>> widget always in focus. This may be a lot of work for you, but the ends >>>>> justifies the means. Your entitled to your opinion of course; however, >>>>> aside from the learning opportunity, you still are assuming that this >>>>> widget is always going to be in focus. FOr me I always have the calendar >>>>> available. Another point here to keep in mind is that you cannot control >>>>> the sources of the weather widget; however, this script could conceivably >>>>> be used to pull weather data from nearly any source. In fact you could >>>>> even have your own weather station and use such a script to capture the >>>>> information from that weather station. >>>>> On Sep 11, 2011, at 8:14 AM, Donna Goodin wrote: >>>>> >>>>>> True, it is a learning opportunity. though to me it seems like a lot of >>>>>> work just to duplicate something that already exists on the Mac. Just >>>>>> my $.02. >>>>>> Cheers, >>>>>> donna >>>>>> >>>>>> On Sep 11, 2011, at 8:09 AM, Scott Howell wrote: >>>>>> >>>>>>> What amazes me is that some missed the point of the script. Ricardo >>>>>>> points out that hitting f12 drops him on the weather widget and that >>>>>>> is just great; however, not everyone has that particular item there >>>>>>> at all times. iN fact I tend to keep the >>>>>>> calendar widget as the one with focus. The other point some have missed >>>>>>> here is the learning opportunity of how such scripts could be very >>>>>>> useful. Perhaps there are other ways to accomplish the same task, but >>>>>>> you need to look beyond this specific task and see it for what it is >>>>>>> and that is a learning opportunity. So, what more do "you people want?" >>>>>>> Not much, but a new experience in how something simple can be used for >>>>>>> other tasks. Of course if there is a way to use the applications >>>>>>> available in the OS such as curl that would be great since it means >>>>>>> just one less thing to load. >>>>>>> >>>>>>> On Sep 11, 2011, at 7:31 AM, Donna Goodin wrote: >>>>>>> >>>>>>>> That was my question, too, Ricardo. Then if you VO to the right and >>>>>>>> interact, you get a 6-day forecast. What more do people want? >>>>>>>> Cheers, >>>>>>>> Donna >>>>>>>> >>>>>>>> On Sep 11, 2011, at 2:36 AM, Ricardo Walker wrote: >>>>>>>> >>>>>>>>> Hi, >>>>>>>>> >>>>>>>>> You know what, >>>>>>>>> >>>>>>>>> For me, when I press F12, the focus automatically falls on the >>>>>>>>> temperature and current weather condition in dash board. Isn't that >>>>>>>>> what people are pretty much looking for? Press 1 key and get your >>>>>>>>> current weather? >>>>>>>>> >>>>>>>>> Ricardo Walker >>>>>>>>> rwalker...@gmail.com >>>>>>>>> Twitter & Skype: rwalker296 >>>>>>>>> www.mobileaccess.org >>>>>>>>> >>>>>>>>> On Sep 11, 2011, at 2:10 AM, Teresa Cochran wrote: >>>>>>>>> >>>>>>>>>> Thanks, Keith. That's pretty slick. I don't mind having MacPorts, >>>>>>>>>> either, as there are some things I wouldn't mind playing with in >>>>>>>>>> there, including the Lynx browser. >>>>>>>>>> >>>>>>>>>> teresa >>>>>>>>>> >>> -- You received this message because you are subscribed to the Google Groups "MacVisionaries" group. To post to this group, send email to macvisionaries@googlegroups.com. To unsubscribe from this group, send email to macvisionaries+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/macvisionaries?hl=en.