Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

moonman239

Cancelled
Original poster
Mar 27, 2009
1,541
32
I'm creating a program that uses NSSpeechRecognizer, and what I'd like to do is have the program respond to commands like "Tell Darian I love her". The only way I can think of is populate the commands array with every word in the English language.
 
I'm creating a program that uses NSSpeechRecognizer, and what I'd like to do is have the program respond to commands like "Tell Darian I love her". The only way I can think of is populate the commands array with every word in the English language.

I don't think NSSpeechRecognizer is the appropriate class for this. It recognises predefined words and phrases, whereas you don't know what you're going to get. What you're looking for is speech to text, ie. dictation.

After a quick hunt around, this is the only suitable looking SDK I can find for recognising speech. You'd have to handle recording the speech and sending it through the API yourself. You'll then get back plain text which you can interpret in whatever way you like. There may be better libraries - I haven't looked too hard.

Or, yes, I suppose you could configure NSSpeechRecognizer to recognise every English word and then add recognised words to a list on every call of didRecognizeCommand. It might be worth a try, but it wouldn't surprise me if it didn't work too well as you wouldn't be using it as designed. It might miss words immediately following a recognised word, or maybe it'll spend so long searching the enormous dictionary that it'll be impractically slow.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.