Take a look here: http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/speech/
This is a replica of the Chrome browser for searching ... you can do it in Objective-C. Try google.com on your Chrome browser and if Spanish is recognized you will win! :)
You can easily use:
- (void) SpeechFromGooglezzz { NSURL *url = [NSURL URLWithString:@"https://www.google.com/speech-api/v1/recognize?xjerr=1&client=chromium&lang=en-US"]; ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url]; NSString *filePath = [NSString stringWithFormat:@"%@%@", [[NSBundle mainBundle] resourcePath], @"tmpAudio.flac"]; NSData *myData = [NSData dataWithContentsOfFile:filePath]; [request addPostValue:myData forKey:@"Content"]; [request addPostValue:@"audio/x-flac; rate=16000" forKey:@"Content-Type"]; [request startSynchronous]; NSLog(@"req: %@", [request responseString]); }
Remember that you must write a FLAC file with a bitrate of 16000! Or nothing!
Google responds to json containing words.
hope this helps.
source share