Continuous Listening with iOS SDK

Hi, this is Mitul Golakiya from Neon Mobile, we were using your ios sdk and need continuous listening for our production release this month. We have SIRI like capability for small medium business and need Continuous Listening for a similar user experience. But it looks like continuous listening is not still implemented with your sdk.

Implemented continuous listening by using one third party class ( AudioProcessor ) which is doing all streaming stuff etc.

Here is the full process that we are doing:

call WatsonSocket.connectWebsocket() method to connect a socket (we made one custom method for it - WatsonSocket.sendContinuous())

Just after that, Start adding captured data to audioUploadQueue (but it will be suspended till we are not connected to IBM WebSocket)

Once web socket is connected and authenticated, queue will be set to suspended=false (SDK is already doing it)

By making suspended=false data queue will start uploading data

Everything is working fine till now, but by this process, sometimes we are getting results and sometimes not. And even if we stop speaking, we are not getting final=true. You mentioned above that, "The service detects the end of the phrase". But it's not. We are getting interim results but not getting final flag true. Socket waits for 30 seconds and does a timeout.

Here is all modified SDK files as well as our project files. Can you let us know if we are missing anything ?

2 answers

I read that you are doing this: "Do not write action=stop just after writing data chunk on socket "

However, in order to get the final result you need to signal the end of audio, there are two wayt to do this:
a) By sending a JSON text message with the action key set to the value stop: {"action": "stop"}
b) By sending an empty binary message

We recently updated the Watson Developer Cloud iOS SDK to support continuous listening. To update to the most recent version, navigate to your project directory in the terminal and execute carthage update --platform iOS.