Ah yes, I had forgotten about the inbuilt voice recognition. I never use it, but it's a piece of cake to program. The code basically looks like "Listen for the user to say 'Play DVD' then start 'DVD Player'..."
Macs have had speech (both text-to-speech and recognition) capabilities for quite some time, but not alot of people are terribly familiar with what it can do. I was pretty well versed with it back in OS9 and earlier, but the latest revisions of the OS have made some great progress.
Speech Recognition + AppleScript is a very potent combination for even beginners. With a little forethought it should be simple to work into any application.
Here is a good article that should bring you up to speed and start you in the right direction: http://www.macdevcenter.com/pub/a/ma...17/speech.html
~Lake
Ah yes, I had forgotten about the inbuilt voice recognition. I never use it, but it's a piece of cake to program. The code basically looks like "Listen for the user to say 'Play DVD' then start 'DVD Player'..."
MY CAR IS FOR SALE!
See My Project Page for Details - 2003 BMW E46 ///M3
Custom Dash Monitor Housing - OEM Fitment
Custom Overhead DVD-ROM Housing in Headliner
BMW I-Bus Integration
My homepage with many other fun projects!
Here's a little example I made, playing with it some. I'd almost forgotten how much fun AppleScript was when you get it right the first time (though it's no more pleasant to debug than anything else, heh).
~lakeCode:tell application "SpeechRecognitionServer" local choices, question set choices to {"Slashdot", "MacSlash", "Google"} set question to "Where would you like to go today?" try set result to listen for choices with prompt question giving up after 10 end try end tell tell application "Safari" if result is "Slashdot" then open location "http://slashdot.org" else if result is "MacSlash" then open location "http://macslash.org" else if result is "Google" then open location "http://google.com" end if end tell
just an FYI: The above script actually works but only by accident. The word "result" is reserved in AppleScript, it's automatically assigned the value of the last expression evaluated. To be 'sane' you'd want to just replace all instances of the word 'result' with some other appropriate variable name (like 'response' or somesuch).
It's been ages since I've really done much with AppleScript, so the above was just thrown together in a vary haphazard way. Re-reading a few things now =)
~Lake
gork if what you say is true, could you possibly program it to play all of an artist? For instance say "play the strokes" and have it play all by the strokes? I hope so, that could be really really really cool.
-matt
Right, you could do that. The iTunes Applescript dictionary includes ways to search by artist, genre, album, etc. You could do what you're suggesting easily.
Want to:
-Find out about the new iBug iPad install?
-Find out about carPC's in just 5 minutes? View the Car PC 101 video
Oh my lord that has just added gallons of fuel to the fire of me getting a minimac. This will be the best project ever!
-matt
What's so special about speech recognition? Windows PCs have been doing it for a long time, and we have quite a few frontends that do speech. Some do speech from the get go, like centrafuse, and others like Frodo do it with the help of support programs, like NaviVoiceOriginally Posted by mattdisaster
![]()
No way? I honestly had no clue it could be done on a pc, I'll have to check into it then, I cant think of anything cooler then "play The Strokes, Is This is" "Mute" "volume Up" oh man, I'de be the coolest person on the block! hah.
-matt
It's not that Macs are unique in their ability to do speech, but it is incredibly well integrated into the operating system and available in the unix shell environment, applescript, and cocoa, as well as ready-made for the user.
Turning on a few options in the system preferences lets me do some rather impressive stuff right off. I can activate buttons on the frontmost window by saying their label, or navigate items in the menu bar (for example in iTunes: "Controls menu; Next Song" will use that menu item to skip the current song).
So you don't even need to specially support Speech in your own application, just take care to 'play nice' and it's automatically supported.
--platform rant--
I gave up on preaching about Macs to 'non-believers' a long time ago. But since you brought it up: It's just one more thing that works the right way on a Mac. It's not impossible in Windows, but it's generally a real pain in the *** and doesn't live up to its potential.
--/platform rant--
~Lake
P.S. I've actually developed for Windows and run a WinXP box for (certain) games, and happen to be typing this on a WinME machine. So it's not as though I'm ignorant of what Windows really is :P
Bookmarks