webspeech api - Using Google Voice Recognition API in building an iOS application -


i developing ios application voice recognition functionality. found way use google web speech api voice recognition , text-to-speech purposes. works fine. wondering if legal use google web speech api in ios application? there limits of usage api? tried find terms of service it, not find any.

record voice standard ios format (example mpeg4). convert recording in flac format (you cannot inside xcode, used php service ffmpeg command). call google service following code:

nsmutableurlrequest *urlgooglerequest = [[nsmutableurlrequest  alloc]initwithurl:urlgoogle]; [urlgooglerequest sethttpmethod:@"post"]; [urlgooglerequest addvalue:@"audio/x-flac; rate=16000" forhttpheaderfield:@"content-type"]; nsurlresponse* response = nil;             nserror* error = nil; [urlgooglerequest sethttpbody:audiodataflac]; nsdata* googleresponse = [nsurlconnection sendsynchronousrequest:urlgooglerequest                                                  returningresponse:&response                                                              error:&error]; id jsonobject=[nsjsonserialization jsonobjectwithdata:googleresponse options:kniloptions error:nil]; 

example response google:

{ "status": 0, "id": "b3447b5d98c5653e0067f35b32c0a8ca-1", "hypotheses": [ { "utterance": "i pickles", "confidence": 0.9012539 }, { "utterance": "i pickle" }] }

this method not straight-forward, anyway works me. remember google speech recognition valid test purpose.

good luck!


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -