wit-ai / wit-ios

Wit.ai iOS client
Other
222 stars 71 forks source link

Getting a lot of what looks to be JSON parsing errors #9

Closed KyleLeneau closed 10 years ago

KyleLeneau commented 10 years ago

I am seeing a bunch of these errors now in the console when running my app:

error: The operation couldn’t be completed. (Cocoa error 3840.)

A little digging on StackOverflow and it looks like some type of JSON parsing error. Any ideas?

blandinw commented 10 years ago

Hm weird, I don't have this error following the Wit iOS tutorial using Wit.framework 1.1.0. A parsing error would be passed to witDidGraspIntent: Do you have any additional info?

KyleLeneau commented 10 years ago

All I know is that I am trying to say "Good Morning" and am getting this error about half (or more) of the time. It's being logged by the existence of an error check (NSLog) in my witDidGraspIntent delegate.

Could it be possible that the recording is not being completed by the time the recording request is going out? I guess I am not quit sure how that recording is happening on a stream and then being chunked to the API.

blandinw commented 10 years ago

Indeed, the buffer being written was not flushed before sending out the HTTP request. This caused the error for very short sentences. 1.1.1 fixes that!

Thanks for your feedback, I'll let you close the issue

KyleLeneau commented 10 years ago

This looks like it is working as expected now. Saw a few speech recognition failures but so far so good for my limited prototyping. Thanks for the help and release.