wit-ai / wit-ios

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

Voice Activity Detection not implemented in iOS 10? #85

Closed mickbyrne closed 6 years ago

mickbyrne commented 6 years ago

I've tried implementing this SDK in an iOS 10 app, and it seems like the speech recognition is not really doing any voice activity detection any longer... is that right?

In particular, the WITSFSpeechRecordingSession class never attempts to detect the end of the speech, a number of the delegate methods are never called. The _vadEnabled property is never queried...

Am I missing something, or is this just sitting in the too hard basket at the moment?

hactar commented 6 years ago

That is correct, because WITSFSpeechRecordingSession uses a different approach to acquiring/buffering/uploading audio data, it wasn't possible to just reuse the same vad code. I tried to find a quick hack (see lines 172+ in WITSFSpeechRecordingSession), but could not get it to work quickly enough, and as I wasn't using vad anyway, I aborted). We'd gladly accept a pull request which adds vad support.

mickbyrne commented 6 years ago

Hi @hactar, thanks for the quick clarification. That's a shame, as I did go digging in all that C code that does the voice detection and it looked pretty good.

I have managed to keep hacking away at your simple amplitude based attempt and got something working that's passable for my application. I'll try and work it back into a push notification later.