Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Speech

  1. #1
    Newbie
    Join Date
    Jan 2005
    Posts
    54

    Speech

    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

  2. #2
    Maximum Bitrate gork's Avatar
    Join Date
    Aug 2003
    Location
    Amarillo, TX
    Posts
    655
    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!

  3. #3
    Newbie
    Join Date
    Jan 2005
    Posts
    54
    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).

    Code:
    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
    ~lake

  4. #4
    Newbie
    Join Date
    Jan 2005
    Posts
    54
    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

  5. #5
    Constant Bitrate
    Join Date
    Oct 2004
    Posts
    177
    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

  6. #6
    Admin. Linux loser.
    Auto Apps:loading...
    Bugbyte's Avatar
    Join Date
    Sep 2004
    Location
    Corning, NY
    Posts
    7,364
    Blog Entries
    2
    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.
    Quote Originally Posted by ghettocruzer View Post
    I was gung ho on building a PC [until] just recently. However, between my new phone having internet and GPS and all...and this kit...Im starting to have trouble justfiying it haha.
    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

  7. #7
    Constant Bitrate
    Join Date
    Oct 2004
    Posts
    177
    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

  8. #8
    My Village Called 0l33l's Avatar
    Join Date
    Jul 2004
    Location
    Berkeley, CA
    Posts
    10,520
    Quote Originally Posted by mattdisaster
    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!
    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 NaviVoice

  9. #9
    Constant Bitrate
    Join Date
    Oct 2004
    Posts
    177
    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

  10. #10
    Newbie
    Join Date
    Jan 2005
    Posts
    54
    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

Page 1 of 2 12 LastLast

Similar Threads

  1. I have speech recogniton working with 1500 cd's
    By kykeon in forum Software & Software Development
    Replies: 14
    Last Post: 01-16-2005, 11:32 PM
  2. SAPI Speech stutters
    By wysocki in forum PowerVoice
    Replies: 2
    Last Post: 11-07-2004, 07:01 AM
  3. Best Man Speech?
    By bosstone74 in forum Off Topic
    Replies: 11
    Last Post: 05-11-2004, 01:48 PM
  4. copilot speech
    By az1324 in forum Software & Software Development
    Replies: 7
    Last Post: 12-28-2002, 12:33 AM
  5. copilot speech
    By Alives in forum Software & Software Development
    Replies: 0
    Last Post: 08-23-2002, 02:52 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •